Versions in this module Expand all Collapse all v1 v1.0.0 Apr 11, 2021 Changes in this version + var NotPtrErr = errors.New("input type is not a slice ptr") + var NotSliceErr = errors.New("input type is not a slice") + func IsRedisNil(err error) bool + func MapStringToMapInterface(v map[string]string) map[string]interface + func MapStringToMapRedisString(v map[string]string) map[string]RedisString + type Caches struct + func CreateCaches() *Caches + func (caches *Caches) Redis(name string) *RedisClient + func (caches *Caches) RegisterRedisClient(name string, config *RedisConfig) error + func (caches *Caches) RegisterRedisClients(configs map[string]*RedisConfig) error + type RedisClient struct + func CreateRedisClient(name string, config *RedisConfig) (*RedisClient, error) + func CreateRedisClientWithDriver(name string, driver *redis.Client) (*RedisClient, error) + func (client *RedisClient) Close() error + func (client *RedisClient) Config() *RedisConfig + func (client *RedisClient) Connect() error + func (client *RedisClient) Copy() *RedisClient + func (client *RedisClient) Counter(key string, args ...interface{}) *RedisCounter + func (client *RedisClient) JSON(key string, args ...interface{}) *RedisJSON + func (client *RedisClient) List(key string, args ...interface{}) *RedisList + func (client *RedisClient) Locker(key string, args ...interface{}) *RedisLocker + func (client *RedisClient) Marker(key string, args ...interface{}) *RedisMarker + func (client *RedisClient) Name() string + func (client *RedisClient) Ping() error + func (client *RedisClient) Reconnect() error + func (client *RedisClient) WithCtx(ctx context.Context) *RedisClient + type RedisClientManager struct + func CreateRedisClientManager() *RedisClientManager + func (manager *RedisClientManager) Clear() + func (manager *RedisClientManager) Get(name string) *RedisClient + func (manager *RedisClientManager) Set(name string, client *RedisClient) + type RedisConfig struct + Database int + DialTimeout int + Host string + MaxRetries int + Password string + Ping bool + PoolSize int + Port int + ReadTimeout int + WriteTimeout int + func (config *RedisConfig) Bind(bs []byte) error + func (config *RedisConfig) Copy() *RedisConfig + type RedisConfigs struct + Items map[string]*RedisConfig + func (configs *RedisConfigs) Bind(bs []byte) error + type RedisCounter struct + func CreateRedisCounter(client *RedisClient, key string, args ...interface{}) *RedisCounter + func (c *RedisCounter) Count() (int64, error) + func (c *RedisCounter) Decr() error + func (c *RedisCounter) DecrOfMarker(marker *RedisMarker) error + func (c *RedisCounter) Destroy() error + func (c *RedisCounter) Incr() error + func (c *RedisCounter) IncrOfMarker(marker *RedisMarker) error + func (c *RedisCounter) Key() string + func (c *RedisCounter) Set(count int64, expiration time.Duration) error + func (c *RedisCounter) Zero(expiration time.Duration) error + type RedisJSON struct + func CreateRedisJSON(client *RedisClient, key string, args ...interface{}) *RedisJSON + func (h *RedisJSON) Destroy() error + func (j *RedisJSON) Exists() (bool, error) + func (j *RedisJSON) Get(v interface{}) error + func (j *RedisJSON) Key() string + func (j *RedisJSON) Set(v interface{}, expiration time.Duration) error + func (j *RedisJSON) SetNX(v interface{}, expiration time.Duration) error + func (j *RedisJSON) SetXX(v interface{}, expiration time.Duration) error + func (j *RedisJSON) TrySetNX(v interface{}, expiration time.Duration) (bool, error) + func (j *RedisJSON) TrySetXX(v interface{}, expiration time.Duration) (bool, error) + type RedisKey string + func (k RedisKey) Format(args ...interface{}) string + func (k RedisKey) String() string + type RedisList struct + func CreateRedisList(client *RedisClient, key string, args ...interface{}) *RedisList + func (list *RedisList) LIndex(index int64, o interface{}) error + func (list *RedisList) LPop(o interface{}) error + func (list *RedisList) LRang(o interface{}) error + func (list *RedisList) RPop(o interface{}) error + func (list *RedisList) RRang(o interface{}) error + type RedisLocker struct + func CreateRedisLocker(client *RedisClient, key string, args ...interface{}) *RedisLocker + func (locker *RedisLocker) DoLock() (ok bool, err error) + func (locker *RedisLocker) DoUnlock() (bool, error) + func (locker *RedisLocker) GetExpiration() time.Duration + func (locker *RedisLocker) GetRetries() int + func (locker *RedisLocker) Key() string + func (locker *RedisLocker) Lock() bool + func (locker *RedisLocker) SetExpiration(expiration time.Duration) *RedisLocker + func (locker *RedisLocker) SetInterval(interval time.Duration) *RedisLocker + func (locker *RedisLocker) SetRetries(retries int) *RedisLocker + func (locker *RedisLocker) Touch(duration time.Duration) error + func (locker *RedisLocker) TouchAt(t time.Time) error + func (locker *RedisLocker) Unlock() bool + type RedisMarker struct + func CreateRedisMarker(client *RedisClient, key string, args ...interface{}) *RedisMarker + func (marker *RedisMarker) Exist() (bool, error) + func (marker *RedisMarker) Expire(duration time.Duration) error + func (marker *RedisMarker) ExpireAt(t time.Time) error + func (marker *RedisMarker) GetExpiration() time.Duration + func (marker *RedisMarker) Key() string + func (marker *RedisMarker) Mark() (bool, error) + func (marker *RedisMarker) SetExpiration(expiration time.Duration) *RedisMarker + func (marker *RedisMarker) Unmark() (bool, error) + type RedisString string + func (s RedisString) Bool() bool + func (s RedisString) Buffer() *bytes.Buffer + func (s RedisString) Bytes() []byte + func (s RedisString) Float32() float32 + func (s RedisString) Float64() float64 + func (s RedisString) Int() int + func (s RedisString) Int16() int16 + func (s RedisString) Int32() int32 + func (s RedisString) Int64() int64 + func (s RedisString) Int8() int8 + func (s RedisString) IsEmpty() bool + func (s RedisString) JSON(v interface{}) error + func (s RedisString) ParseTime(layout string) time.Time + func (s RedisString) Slice(sep string) []string + func (s RedisString) String() string + func (s RedisString) Time() time.Time + func (s RedisString) TryBool() (bool, error) + func (s RedisString) TryFloat32() (float32, error) + func (s RedisString) TryFloat64() (float64, error) + func (s RedisString) TryInt() (int, error) + func (s RedisString) TryInt16() (int16, error) + func (s RedisString) TryInt32() (int32, error) + func (s RedisString) TryInt64() (int64, error) + func (s RedisString) TryInt8() (int8, error) + func (s RedisString) TryParseTime(layout string) (time.Time, error) + func (s RedisString) TryTime() (time.Time, error) + func (s RedisString) TryUint() (uint, error) + func (s RedisString) TryUint16() (uint16, error) + func (s RedisString) TryUint32() (uint32, error) + func (s RedisString) TryUint64() (uint64, error) + func (s RedisString) TryUint8() (uint8, error) + func (s RedisString) Uint() uint + func (s RedisString) Uint16() uint16 + func (s RedisString) Uint32() uint32 + func (s RedisString) Uint64() uint64 + func (s RedisString) Uint8() uint8