Versions in this module Expand all Collapse all v1 v1.1.6 Jul 1, 2024 Changes in this version + const DefaultGroupName + const DistCacheName + func SetConfig(config *Config, name ...string) + type Config struct + Dir string + type Dist struct + func New(name ...string) *Dist + func NewDist() *Dist + func (d *Dist) Clear(ctx context.Context) error + func (d *Dist) Close(ctx context.Context) error + func (d *Dist) Contains(ctx context.Context, key interface{}) (b bool, err error) + func (d *Dist) Data(ctx context.Context) (data map[interface{}]interface{}, err error) + func (d *Dist) Get(ctx context.Context, key interface{}) (value *gvar.Var, err error) + func (d *Dist) GetExpire(ctx context.Context, key interface{}) (duration time.Duration, err error) + func (d *Dist) GetOrSet(ctx context.Context, key interface{}, value interface{}, ...) (result *gvar.Var, err error) + func (d *Dist) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error) + func (d *Dist) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error) + func (d *Dist) Keys(ctx context.Context) (keys []interface{}, err error) + func (d *Dist) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error) + func (d *Dist) Set(ctx context.Context, key interface{}, value interface{}, ...) error + func (d *Dist) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, ...) (ok bool, err error) + func (d *Dist) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error) + func (d *Dist) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error) + func (d *Dist) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) error + func (d *Dist) Size(ctx context.Context) (size int, err error) + func (d *Dist) Update(ctx context.Context, key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error) + func (d *Dist) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error) + func (d *Dist) Values(ctx context.Context) (values []interface{}, err error)