Versions in this module Expand all Collapse all v0 v0.0.2 Nov 29, 2022 v0.0.1 Nov 29, 2022 Changes in this version + const ATTR_EXPIRE + const Serilizer_JSON + func Redis(config mstruct.MCacheConfig) *redis.Client + type DBGettFunc func() interface + type InterfaceResult struct + Err error + Result interface{} + func NewInterfaceResult(result interface{}, err error) *InterfaceResult + func (this *InterfaceResult) UnWrap() interface{} + func (this *InterfaceResult) UnWrapDefault(def interface{}) interface{} + type OperationAttr struct + Name string + Value interface{} + func WithExpire(t time.Duration) *OperationAttr + type OperationAttrs []*OperationAttr + func (this OperationAttrs) Find(name string) *InterfaceResult + type SimpleCache struct + DBGeter DBGettFunc + Expire time.Duration + Operation *StringOperation + Serilizer string + func NewSimpleCache(operation *StringOperation, expire time.Duration, serilizer string) *SimpleCache + func (this *SimpleCache) Del(key string) + func (this *SimpleCache) GetCache(key string) (ret interface{}) + func (this *SimpleCache) Lock(key string, exp time.Duration) bool + func (this *SimpleCache) SetCache(key string, value interface{}) + func (this *SimpleCache) Unlock(key string) + type StringOperation struct + func NewStringOperation(config mstruct.MCacheConfig) *StringOperation + func (this *StringOperation) Del(key string) + func (this *StringOperation) Get(key string) *StringResult + func (this *StringOperation) Set(key string, value interface{}, attrs ...*OperationAttr) *InterfaceResult + func (this *StringOperation) SetNx(key string, value interface{}, attrs ...*OperationAttr) *InterfaceResult + func (this *StringOperation) SetXx(key string, value interface{}, attrs ...*OperationAttr) *InterfaceResult + type StringResult struct + Err error + Result string + func NewStringResult(result string, err error) *StringResult + func (this *StringResult) Unwrap() string + func (this *StringResult) UnwrapDefault(def string) string + func (this *StringResult) UnwrapElse(f func() string) interface{}