IRedisClient
Demis Bellot edited this page May 8, 2014 ·
4 revisions
Pages 16
Details of the IRedisClient API implemented by the ServiceStack.Redis client
Introduction
This is a friendly, more descriptive API implemented by the ServiceStack.Redis client that provides access to key values as strings (or collection of strings for Redis lists and sets).
Use this API if you just need to access values as strings or you want to have control over your own text serialization format.
IRedisClient API
public interface IRedisClient
: IEntityStore, ICacheClient
{
//Basic Redis Connection operations
long Db { get; set; }
long DbSize { get; }
Dictionary<string, string> Info { get; }
DateTime LastSave { get; }
string Host { get; }
int Port { get; }
int ConnectTimeout { get; set; }
int RetryTimeout { get; set; }
int RetryCount { get; set; }
int SendTimeout { get; set; }
string Password { get; set; }
bool HadExceptions { get; }
void Save();
void SaveAsync();
void Shutdown();
void RewriteAppendOnlyFileAsync();
void FlushDb();
//Basic Redis Connection Info
string this[string key] { get; set; }
List<string> GetAllKeys();
void SetEntry(string key, string value);
void SetEntry(string key, string value, TimeSpan expireIn);
bool SetEntryIfNotExists(string key, string value);
void SetAll(IEnumerable<string> keys, IEnumerable<string> values);
void SetAll(Dictionary<string, string> map);
string GetEntry(string key);
string GetValue(string key);
string GetAndSetEntry(string key, string value);
List<string> GetValues(List<string> keys);
List<T> GetValues<T>(List<string> keys);
Dictionary<string, string> GetValuesMap(List<string> keys);
Dictionary<string, T> GetValuesMap<T>(List<string> keys);
long AppendToValue(string key, string value);
void RenameKey(string fromName, string toName);
//store POCOs as hash
T GetFromHash<T>(object id);
void StoreAsHash<T>(T entity);
object StoreObject(object entity);
bool ContainsKey(string key);
bool RemoveEntry(params string[] args);
long IncrementValue(string key);
long IncrementValueBy(string key, int count);
long IncrementValueBy(string key, long count);
double IncrementValueBy(string key, double count);
long DecrementValue(string key);
long DecrementValueBy(string key, int count);
List<string> SearchKeys(string pattern);
RedisKeyType GetEntryType(string key);
string GetRandomKey();
bool ExpireEntryIn(string key, TimeSpan expireIn);
bool ExpireEntryAt(string key, DateTime expireAt);
TimeSpan GetTimeToLive(string key);
List<string> GetSortedEntryValues(string key, int startingFrom, int endingAt);
//Store entities without registering entity ids
void WriteAll<TEntity>(IEnumerable<TEntity> entities);
//Scan APIs
IEnumerable<string> ScanAllKeys(string pattern = null