Versions in this module Expand all Collapse all v0 v0.8.1 Feb 21, 2022 v0.8.0 Feb 11, 2022 Changes in this version + var Databases = services.DatabaseDefinitions + var NotFound = fmt.Errorf("not found") + var RedisForm = forms.Form + var RedisShardForm = forms.Form + func MakeInMemory(settings interface{}) (services.Database, error) + func MakeRedisAsDatabase(settings interface{}) (services.Database, error) + func MakeRedisClient(settings interface{}) (redis.UniversalClient, uint32, error) + func MakeRedisShardAsDatabase(settings interface{}) (services.Database, error) + func ValidateInMemorySettings(settings map[string]interface{}) (interface{}, error) + func ValidateRedisSettings(settings map[string]interface{}) (interface{}, error) + func ValidateRedisShardSettings(settings map[string]interface{}) (interface{}, error) + type InMemory struct + Data map[string][][]byte + TTLs []*TTL + func (d *InMemory) Close() error + func (d *InMemory) Expire(table string, key []byte, ttl time.Duration) error + func (d *InMemory) ExpireAt(table string, key []byte, tm time.Time) error + func (d *InMemory) Integer(table string, key []byte) services.Integer + func (d *InMemory) List(table string, key []byte) services.List + func (d *InMemory) Lock(lockKey string, a, b time.Duration) (services.Lock, error) + func (d *InMemory) LockDefault(key string) (services.Lock, error) + func (d *InMemory) Map(table string, key []byte) services.Map + func (d *InMemory) Open() error + func (d *InMemory) Reset() error + func (d *InMemory) Set(table string, key []byte) services.Set + func (d *InMemory) SortedSet(table string, key []byte) services.SortedSet + func (d *InMemory) Value(table string, key []byte) services.Value + type InMemorySettings struct + type MetricHook struct + func (m MetricHook) AfterProcess(ctx context.Context, cmd redis.Cmder) error + func (m MetricHook) AfterProcessPipeline(ctx context.Context, cmds []redis.Cmder) error + func (m MetricHook) BeforeProcess(ctx context.Context, cmd redis.Cmder) (context.Context, error) + func (m MetricHook) BeforeProcessPipeline(ctx context.Context, cmds []redis.Cmder) (context.Context, error) + type Redis struct + Ctx context.Context + func MakeRedis(settings interface{}) (*Redis, error) + func MakeRedisShards(settings interface{}) (*Redis, error) + func (d *Redis) Client(key string) redis.UniversalClient + func (d *Redis) Close() error + func (d *Redis) Expire(table string, key []byte, ttl time.Duration) error + func (d *Redis) ExpireAt(table string, key []byte, tm time.Time) error + func (d *Redis) Integer(table string, key []byte) services.Integer + func (d *Redis) List(table string, key []byte) services.List + func (d *Redis) Lock(lockKey string, lockWait time.Duration, ttl time.Duration) (services.Lock, error) + func (d *Redis) LockDefault(key string) (services.Lock, error) + func (d *Redis) Map(table string, key []byte) services.Map + func (d *Redis) Open() error + func (d *Redis) Reset() error + func (d *Redis) Set(table string, key []byte) services.Set + func (d *Redis) SortedSet(table string, key []byte) services.SortedSet + func (d *Redis) Value(table string, key []byte) services.Value + type RedisInteger struct + func (r *RedisInteger) DecrBy(value int64) (int64, error) + func (r *RedisInteger) Del() error + func (r *RedisInteger) Get() (int64, error) + func (r *RedisInteger) IncrBy(value int64) (int64, error) + func (r *RedisInteger) Set(value int64, ttl time.Duration) error + type RedisLock struct + func (r *RedisLock) Release() error + type RedisMap struct + func (r *RedisMap) Del(key []byte) error + func (r *RedisMap) Get(key []byte) ([]byte, error) + func (r *RedisMap) GetAll() (map[string][]byte, error) + func (r *RedisMap) Set(key []byte, value []byte) error + type RedisSet struct + func (r *RedisSet) Add(data []byte) error + func (r *RedisSet) Del(data []byte) error + func (r *RedisSet) Has(data []byte) (bool, error) + func (r *RedisSet) Members() ([]*services.SetEntry, error) + type RedisSettings struct + Addresses []string + Database int64 + MasterName string + Password string + SentinelAddresses []string + SentinelPassword string + SentinelUsername string + ShardIndex int64 + type RedisShardSettings struct + Shards []RedisSettings + type RedisSortedSet struct + func (r *RedisSortedSet) Add(data []byte, score int64) error + func (r *RedisSortedSet) At(index int64) (*services.SortedSetEntry, error) + func (r *RedisSortedSet) Del(data []byte) (bool, error) + func (r *RedisSortedSet) PopMin(n int64) ([]*services.SortedSetEntry, error) + func (r *RedisSortedSet) Range(from, to int64) ([]*services.SortedSetEntry, error) + func (r *RedisSortedSet) RangeByScore(from, to int64) ([]*services.SortedSetEntry, error) + func (r *RedisSortedSet) RemoveRangeByScore(from, to int64) error + func (r *RedisSortedSet) Score(data []byte) (int64, error) + type RedisValue struct + func (r *RedisValue) Del() error + func (r *RedisValue) Get() ([]byte, error) + func (r *RedisValue) Set(data []byte, ttl time.Duration) error + type TTL struct + Key string + TTL time.Time