~ubuntu-branches/ubuntu/trusty/smuxi/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/ServiceStack/src/ServiceStack.Interfaces/Redis/IRedisNativeClient.cs

  • Committer: Package Import Robot
  • Author(s): Mirco Bauer
  • Date: 2013-05-25 22:11:31 UTC
  • mfrom: (1.2.12)
  • Revision ID: package-import@ubuntu.com-20130525221131-nd2mc0kzubuwyx20
Tags: 0.8.11-1
* [22d13d5] Imported Upstream version 0.8.11
* [6d2b95a] Refreshed patches
* [89eb66e] Added ServiceStack libraries to smuxi-engine package
* [848ab10] Enable Campfire engine
* [c6dbdc7] Always build db4o for predictable build result
* [13ec489] Exclude OS X specific libraries from dh_clideps

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// http://code.google.com/p/servicestack/wiki/ServiceStackRedis
 
3
// ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system
 
4
//
 
5
// Authors:
 
6
//   Demis Bellot (demis.bellot@gmail.com)
 
7
//
 
8
// Copyright 2010 Liquidbit Ltd.
 
9
//
 
10
// Licensed under the same terms of Redis and ServiceStack: new BSD license.
 
11
//
 
12
 
 
13
using System;
 
14
using System.Collections.Generic;
 
15
 
 
16
namespace ServiceStack.Redis
 
17
{
 
18
        public interface IRedisNativeClient
 
19
                : IDisposable
 
20
        {
 
21
                //Redis utility operations
 
22
                Dictionary<string, string> Info { get; }
 
23
                int Db { get; set; }
 
24
                int DbSize { get; }
 
25
                DateTime LastSave { get; }
 
26
                void Save();
 
27
                void BgSave();
 
28
                void Shutdown();
 
29
                void BgRewriteAof();
 
30
                void Quit();
 
31
                void FlushDb();
 
32
                void FlushAll();
 
33
                bool Ping();
 
34
                string Echo(string text);
 
35
                void SlaveOf(string hostname, int port);
 
36
                void SlaveOfNoOne();
 
37
                byte[][] ConfigGet(string pattern);
 
38
                void ConfigSet(string item, byte[] value);
 
39
                void ConfigResetStat();
 
40
                byte[][] Time();
 
41
                void DebugSegfault();
 
42
                byte[] Dump(string key);
 
43
                byte[] Restore(string key, long expireMs, byte[] dumpValue);
 
44
                void Migrate(string host, int port, int destinationDb, long timeoutMs);
 
45
                bool Move(string key, int db);
 
46
                int ObjectIdleTime(string key);
 
47
 
 
48
                //Common key-value Redis operations
 
49
                byte[][] Keys(string pattern);
 
50
                int Exists(string key);
 
51
                int StrLen(string key);
 
52
                void Set(string key, byte[] value);
 
53
                void SetEx(string key, int expireInSeconds, byte[] value);
 
54
                bool Persist(string key);
 
55
                void PSetEx(string key, long expireInMs, byte[] value);
 
56
                int SetNX(string key, byte[] value);
 
57
                void MSet(byte[][] keys, byte[][] values);
 
58
                void MSet(string[] keys, byte[][] values);
 
59
                bool MSetNx(byte[][] keys, byte[][] values);
 
60
                bool MSetNx(string[] keys, byte[][] values);
 
61
                byte[] Get(string key);
 
62
                byte[] GetSet(string key, byte[] value);
 
63
                byte[][] MGet(params byte[][] keys);
 
64
                byte[][] MGet(params string[] keys);
 
65
                int Del(string key);
 
66
                int Del(params string[] keys);
 
67
                long Incr(string key);
 
68
                long IncrBy(string key, int incrBy);
 
69
                double IncrByFloat(string key, double incrBy);
 
70
                long Decr(string key);
 
71
                long DecrBy(string key, int decrBy);
 
72
                int Append(string key, byte[] value);
 
73
                [Obsolete("Was renamed to GetRange in 2.4")]
 
74
                byte[] Substr(string key, int fromIndex, int toIndex);
 
75
                byte[] GetRange(string key, int fromIndex, int toIndex);
 
76
                int SetRange(string key, int offset, byte[] value);
 
77
                int GetBit(string key, int offset);
 
78
                int SetBit(string key, int offset, int value);
 
79
                
 
80
                string RandomKey();
 
81
                void Rename(string oldKeyname, string newKeyname);
 
82
                bool RenameNx(string oldKeyname, string newKeyname);
 
83
                bool Expire(string key, int seconds);
 
84
                bool PExpire(string key, long ttlMs);
 
85
                bool ExpireAt(string key, long unixTime);
 
86
                bool PExpireAt(string key, long unixTimeMs);
 
87
                int Ttl(string key);
 
88
                long PTtl(string key);
 
89
 
 
90
                //Redis Sort operation (works on lists, sets or hashes)
 
91
                byte[][] Sort(string listOrSetId, SortOptions sortOptions);
 
92
 
 
93
                //Redis List operations
 
94
                byte[][] LRange(string listId, int startingFrom, int endingAt);
 
95
                int RPush(string listId, byte[] value);
 
96
                int RPushX(string listId, byte[] value);
 
97
                int LPush(string listId, byte[] value);
 
98
                int LPushX(string listId, byte[] value);
 
99
                void LTrim(string listId, int keepStartingFrom, int keepEndingAt);
 
100
                int LRem(string listId, int removeNoOfMatches, byte[] value);
 
101
                int LLen(string listId);
 
102
                byte[] LIndex(string listId, int listIndex);
 
103
                void LSet(string listId, int listIndex, byte[] value);
 
104
                byte[] LPop(string listId);
 
105
                byte[] RPop(string listId);
 
106
                byte[][] BLPop(string listId, int timeOutSecs);
 
107
            byte[][] BLPop(string[] listIds, int timeOutSecs);
 
108
                byte[] BLPopValue(string listId, int timeOutSecs);
 
109
            byte[][] BLPopValue(string[] listIds, int timeOutSecs);
 
110
                byte[][] BRPop(string listId, int timeOutSecs);
 
111
            byte[][] BRPop(string[] listIds, int timeOutSecs);
 
112
                byte[] RPopLPush(string fromListId, string toListId);
 
113
                byte[] BRPopValue(string listId, int timeOutSecs);
 
114
            byte[][] BRPopValue(string[] listIds, int timeOutSecs);
 
115
 
 
116
                //Redis Set operations
 
117
                byte[][] SMembers(string setId);
 
118
                int SAdd(string setId, byte[] value);
 
119
                int SRem(string setId, byte[] value);
 
120
                byte[] SPop(string setId);
 
121
                void SMove(string fromSetId, string toSetId, byte[] value);
 
122
                int SCard(string setId);
 
123
                int SIsMember(string setId, byte[] value);
 
124
                byte[][] SInter(params string[] setIds);
 
125
                void SInterStore(string intoSetId, params string[] setIds);
 
126
                byte[][] SUnion(params string[] setIds);
 
127
                void SUnionStore(string intoSetId, params string[] setIds);
 
128
                byte[][] SDiff(string fromSetId, params string[] withSetIds);
 
129
                void SDiffStore(string intoSetId, string fromSetId, params string[] withSetIds);
 
130
                byte[] SRandMember(string setId);
 
131
 
 
132
 
 
133
                //Redis Sorted Set operations
 
134
                int ZAdd(string setId, double score, byte[] value);
 
135
                int ZAdd(string setId, long score, byte[] value);
 
136
                int ZRem(string setId, byte[] value);
 
137
                double ZIncrBy(string setId, double incrBy, byte[] value);
 
138
                double ZIncrBy(string setId, long incrBy, byte[] value);
 
139
                int ZRank(string setId, byte[] value);
 
140
                int ZRevRank(string setId, byte[] value);
 
141
                byte[][] ZRange(string setId, int min, int max);
 
142
                byte[][] ZRangeWithScores(string setId, int min, int max);
 
143
                byte[][] ZRevRange(string setId, int min, int max);
 
144
                byte[][] ZRevRangeWithScores(string setId, int min, int max);
 
145
                byte[][] ZRangeByScore(string setId, double min, double max, int? skip, int? take);
 
146
                byte[][] ZRangeByScore(string setId, long min, long max, int? skip, int? take);
 
147
                byte[][] ZRangeByScoreWithScores(string setId, double min, double max, int? skip, int? take);
 
148
                byte[][] ZRangeByScoreWithScores(string setId, long min, long max, int? skip, int? take);
 
149
                byte[][] ZRevRangeByScore(string setId, double min, double max, int? skip, int? take);
 
150
                byte[][] ZRevRangeByScore(string setId, long min, long max, int? skip, int? take);
 
151
                byte[][] ZRevRangeByScoreWithScores(string setId, double min, double max, int? skip, int? take);
 
152
                byte[][] ZRevRangeByScoreWithScores(string setId, long min, long max, int? skip, int? take);
 
153
                int ZRemRangeByRank(string setId, int min, int max);
 
154
                int ZRemRangeByScore(string setId, double fromScore, double toScore);
 
155
                int ZRemRangeByScore(string setId, long fromScore, long toScore);
 
156
                int ZCard(string setId);
 
157
                double ZScore(string setId, byte[] value);
 
158
                int ZUnionStore(string intoSetId, params string[] setIds);
 
159
                int ZInterStore(string intoSetId, params string[] setIds);
 
160
 
 
161
                //Redis Hash operations
 
162
                int HSet(string hashId, byte[] key, byte[] value);
 
163
                void HMSet(string hashId, byte[][] keys, byte[][] values);
 
164
                int HSetNX(string hashId, byte[] key, byte[] value);
 
165
                int HIncrby(string hashId, byte[] key, int incrementBy);
 
166
                double HIncrbyFloat(string hashId, byte[] key, double incrementBy);
 
167
                byte[] HGet(string hashId, byte[] key);
 
168
                byte[][] HMGet(string hashId, params byte[][] keys);
 
169
                int HDel(string hashId, byte[] key);
 
170
                int HExists(string hashId, byte[] key);
 
171
                int HLen(string hashId);
 
172
                byte[][] HKeys(string hashId);
 
173
                byte[][] HVals(string hashId);
 
174
                byte[][] HGetAll(string hashId);
 
175
 
 
176
                //Redis Pub/Sub operations
 
177
                void Watch(params string[] keys);
 
178
                void UnWatch();
 
179
                int Publish(string toChannel, byte[] message);
 
180
                byte[][] Subscribe(params string[] toChannels);
 
181
                byte[][] UnSubscribe(params string[] toChannels);
 
182
                byte[][] PSubscribe(params string[] toChannelsMatchingPatterns);
 
183
                byte[][] PUnSubscribe(params string[] toChannelsMatchingPatterns);
 
184
                byte[][] ReceiveMessages();
 
185
 
 
186
                int EvalInt(string body, int numberKeysInArgs, params byte[][] keys);
 
187
                string EvalStr(string body, int numberKeysInArgs, params byte[][] keys);
 
188
                byte[][] Eval(string body, int numberKeysInArgs, params byte[][] keys);
 
189
                byte[][] ScriptExists(params byte[][] sha1Refs);
 
190
                void ScriptFlush();
 
191
                void ScriptKill();
 
192
                byte[] ScriptLoad(string body);
 
193
        }
 
194
}
 
 
b'\\ No newline at end of file'