2
// http://code.google.com/p/servicestack/wiki/ServiceStackRedis
3
// ServiceStack.Redis: ECMA CLI Binding to the Redis key-value storage system
6
// Demis Bellot (demis.bellot@gmail.com)
8
// Copyright 2010 Liquidbit Ltd.
10
// Licensed under the same terms of Redis and ServiceStack: new BSD license.
14
using System.Collections.Generic;
16
namespace ServiceStack.Redis
18
public interface IRedisNativeClient
21
//Redis utility operations
22
Dictionary<string, string> Info { get; }
25
DateTime LastSave { get; }
34
string Echo(string text);
35
void SlaveOf(string hostname, int port);
37
byte[][] ConfigGet(string pattern);
38
void ConfigSet(string item, byte[] value);
39
void ConfigResetStat();
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);
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);
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);
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);
88
long PTtl(string key);
90
//Redis Sort operation (works on lists, sets or hashes)
91
byte[][] Sort(string listOrSetId, SortOptions sortOptions);
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);
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);
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);
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);
176
//Redis Pub/Sub operations
177
void Watch(params string[] keys);
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();
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);
192
byte[] ScriptLoad(string body);
b'\\ No newline at end of file'