Versions in this module Expand all Collapse all v1 v1.0.46 May 27, 2022 Changes in this version + const AttrExpr + const AttrNx + const SerializerJson + const SerializerString + type App struct + Addr string + DB int + Db *redis.Client + Password string + PoolSize int + func (app *App) InitClient() + func (app *App) NewListOperation() *ListOperation + func (app *App) NewSimpleCache(operation *StringOperation, expire time.Duration, serializer string) *SimpleCache + func (app *App) NewSimpleInterfaceCache(operation *StringOperation, expire time.Duration) *SimpleInterfaceCache + func (app *App) NewSimpleJsonCache(operation *StringOperation, expire time.Duration) *SimpleJsonCache + func (app *App) NewSimpleStringCache(operation *StringOperation, expire time.Duration) *SimpleStringCache + func (app *App) NewStringOperation() *StringOperation + type DBGttFunc func() string + type DBGttInterfaceFunc func() interface + type DBGttJsonFunc func() interface + type DBGttStringFunc func() string + type HashOperation struct + func NewHashOperation(db *redis.Client, ctx context.Context) *HashOperation + func (cl *HashOperation) Get(key, field string) *redis.StringCmd + func (cl *HashOperation) Set(key string, value interface{}) *redis.IntCmd + type Iterator struct + func NewIterator(data []interface{}) *Iterator + func (i *Iterator) HasNext() bool + func (i *Iterator) Next() (Ret interface{}) + type JsonGttFunc func() interface + type ListOperation struct + func (cl *ListOperation) Index(key string, index int64) *redis.StringCmd + func (cl *ListOperation) Insert(key, op string, pivot, value interface{}) *redis.IntCmd + func (cl *ListOperation) LPop(key string) *redis.StringCmd + func (cl *ListOperation) LPush(key string, value interface{}) *redis.IntCmd + func (cl *ListOperation) LPushX(key string, value interface{}) *redis.IntCmd + func (cl *ListOperation) Len(key string) *redis.IntCmd + func (cl *ListOperation) RPop(key string) *redis.StringCmd + func (cl *ListOperation) RPush(key string, value interface{}) *redis.IntCmd + func (cl *ListOperation) RPushX(key string, value interface{}) *redis.IntCmd + func (cl *ListOperation) Range(key string, start, stop int64) *redis.StringSliceCmd + func (cl *ListOperation) RangeAli(key string) *redis.StringSliceCmd + func (cl *ListOperation) Rem(key string, count int64, value interface{}) *redis.IntCmd + type OperationAttr struct + Name string + Value interface{} + func WithExpire(t time.Duration) *OperationAttr + func WithNX() *OperationAttr + type OperationAttrs []*OperationAttr + func (a OperationAttrs) Find(name string) interface{} + type SimpleCache struct + DBGetter DBGttFunc + Expire time.Duration + JsonGetter JsonGttFunc + Operation *StringOperation + Serializer string + func (c *SimpleCache) GetCache(key string) (ret interface{}) + func (c *SimpleCache) SetCache(key string, value interface{}) + type SimpleInterfaceCache struct + DBGetter DBGttInterfaceFunc + Expire time.Duration + Operation *StringOperation + func (c *SimpleInterfaceCache) GetCache(key string) (ret string) + func (c *SimpleInterfaceCache) SetCache(key string, value interface{}) + type SimpleJsonCache struct + DBGetter DBGttJsonFunc + Expire time.Duration + Operation *StringOperation + func (c *SimpleJsonCache) GetCache(key string) (ret interface{}) + func (c *SimpleJsonCache) SetCache(key string, value interface{}) + type SimpleStringCache struct + DBGetter DBGttStringFunc + Expire time.Duration + Operation *StringOperation + func (c *SimpleStringCache) GetCache(key string) (ret string) + func (c *SimpleStringCache) SetCache(key string, value string) + type SliceResult struct + Err error + Result []interface{} + func NewSliceResult(result []interface{}, err error) *SliceResult + func (r *SliceResult) Iter() *Iterator + func (r *SliceResult) Unwrap() []interface{} + func (r *SliceResult) UnwrapOr(defaults []interface{}) []interface{} + type StringOperation struct + func (o *StringOperation) Del(keys ...string) *redis.IntCmd + func (o *StringOperation) Get(key string) *StringResult + func (o *StringOperation) MGet(keys ...string) *SliceResult + func (o *StringOperation) Set(key string, value interface{}, attrs ...*OperationAttr) *StringResult + type StringResult struct + Err error + Result string + func NewStringResult(result string, err error) *StringResult + func (r *StringResult) Unwrap() string + func (r *StringResult) UnwrapOr(defaults string) string + func (r *StringResult) UnwrapOrElse(f func() string) string