Versions in this module Expand all Collapse all v1 v1.0.3 Jul 19, 2021 Changes in this version + const AttrExpr + const AttrNx + const SerializerJson + const SerializerSimpleJson + const SerializerString + var Rdb *redis.Client + var RdbC *redis.ClusterClient + func InitClusterRedis(adds []string, password string) (err error) + func InitRedis(host string, port int, password string, db int) (err error) + func InitSentinelRedis(adds []string, masterName string, password string, db int) (err error) + func Version() string + type DBGttFunc func() string + type Iterator struct + func NewIterator(data []interface{}) *Iterator + func (i *Iterator) HasNext() bool + func (i *Iterator) Next() (Ret interface{}) + type JsonGttFunc func() interface + 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 + SimpleJsonGetter SimpleJsonGttFunc + func NewSimpleCache(operation *StringOperation, expire time.Duration, serializer string) *SimpleCache + func (c *SimpleCache) GetCache(key string) (ret interface{}) + func (c *SimpleCache) GetCacheSimpleJson(key string) (js *simplejson.Json) + func (c *SimpleCache) SetCache(key string, value interface{}) + type SimpleJsonGttFunc func() *simplejson.Json + 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 NewStringOperation() *StringOperation + 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