Documentation
¶
Index ¶
- func NewAdapterElasticsearch(name string) gcache.Adapter
- func NewAdapterFile(filePath string) gcache.Adapter
- func NewAdapterMemcached(redis *gredis.Redis) gcache.Adapter
- func NewAdapterMemory() gcache.Adapter
- func NewAdapterRedis(name string) gcache.Adapter
- type AdapterElasticsearch
- func (a AdapterElasticsearch) Clear(ctx context.Context) error
- func (a AdapterElasticsearch) Close(ctx context.Context) error
- func (a AdapterElasticsearch) Contains(ctx context.Context, key interface{}) (bool, error)
- func (a AdapterElasticsearch) Data(ctx context.Context) (data map[interface{}]interface{}, err error)
- func (a AdapterElasticsearch) Get(ctx context.Context, key interface{}) (res *gvar.Var, err error)
- func (a AdapterElasticsearch) GetExpire(ctx context.Context, key interface{}) (time.Duration, error)
- func (a AdapterElasticsearch) GetOrSet(ctx context.Context, key interface{}, value interface{}, ...) (result *gvar.Var, err error)
- func (a AdapterElasticsearch) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)
- func (a AdapterElasticsearch) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)
- func (a AdapterElasticsearch) Keys(ctx context.Context) (keys []interface{}, err error)
- func (a AdapterElasticsearch) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error)
- func (a AdapterElasticsearch) Set(ctx context.Context, _key interface{}, value interface{}, ...) (err error)
- func (a AdapterElasticsearch) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, ...) (ok bool, err error)
- func (a AdapterElasticsearch) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)
- func (a AdapterElasticsearch) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)
- func (a AdapterElasticsearch) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) error
- func (a AdapterElasticsearch) Size(ctx context.Context) (size int, err error)
- func (a AdapterElasticsearch) Update(ctx context.Context, _key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error)
- func (a AdapterElasticsearch) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error)
- func (a AdapterElasticsearch) Values(ctx context.Context) (values []interface{}, err error)
- type AdapterFile
- func (a *AdapterFile) AddIndex(FileName interface{}, duration time.Duration)
- func (a *AdapterFile) Clear(ctx context.Context) error
- func (a *AdapterFile) Close(ctx context.Context) error
- func (a *AdapterFile) Contains(ctx context.Context, key interface{}) (bool, error)
- func (a *AdapterFile) Data(ctx context.Context) (data map[interface{}]interface{}, err error)
- func (a *AdapterFile) DelIndex(FileName interface{})
- func (a *AdapterFile) Get(ctx context.Context, key interface{}) (res *gvar.Var, err error)
- func (a *AdapterFile) GetExpire(ctx context.Context, key interface{}) (time.Duration, error)
- func (a *AdapterFile) GetOrSet(ctx context.Context, key interface{}, value interface{}, ...) (result *gvar.Var, err error)
- func (a *AdapterFile) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)
- func (a *AdapterFile) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)
- func (a *AdapterFile) Key2Name(key interface{}) string
- func (a *AdapterFile) Keys(ctx context.Context) (keys []interface{}, err error)
- func (a *AdapterFile) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error)
- func (a *AdapterFile) Set(ctx context.Context, key interface{}, value interface{}, ...) (err error)
- func (a *AdapterFile) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, ...) (ok bool, err error)
- func (a *AdapterFile) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)
- func (a *AdapterFile) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)
- func (a *AdapterFile) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) (err error)
- func (a *AdapterFile) Size(ctx context.Context) (size int, err error)
- func (a *AdapterFile) Update(ctx context.Context, key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error)
- func (a *AdapterFile) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error)
- func (a *AdapterFile) Values(ctx context.Context) (values []interface{}, err error)
- type AdapterMemcached
- func (a AdapterMemcached) Clear(ctx context.Context) error
- func (a AdapterMemcached) Close(ctx context.Context) error
- func (a AdapterMemcached) Contains(ctx context.Context, key interface{}) (bool, error)
- func (a AdapterMemcached) Data(ctx context.Context) (data map[interface{}]interface{}, err error)
- func (a AdapterMemcached) Get(ctx context.Context, key interface{}) (*gvar.Var, error)
- func (a AdapterMemcached) GetExpire(ctx context.Context, key interface{}) (time.Duration, error)
- func (a AdapterMemcached) GetOrSet(ctx context.Context, key interface{}, value interface{}, ...) (result *gvar.Var, err error)
- func (a AdapterMemcached) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)
- func (a AdapterMemcached) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)
- func (a AdapterMemcached) Keys(ctx context.Context) (keys []interface{}, err error)
- func (a AdapterMemcached) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error)
- func (a AdapterMemcached) Set(ctx context.Context, key interface{}, value interface{}, ...) error
- func (a AdapterMemcached) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, ...) (ok bool, err error)
- func (a AdapterMemcached) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)
- func (a AdapterMemcached) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)
- func (a AdapterMemcached) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) error
- func (a AdapterMemcached) Size(ctx context.Context) (size int, err error)
- func (a AdapterMemcached) Update(ctx context.Context, key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error)
- func (a AdapterMemcached) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error)
- func (a AdapterMemcached) Values(ctx context.Context) (values []interface{}, err error)
- type FileData
- type FileIndex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAdapterElasticsearch ¶
func NewAdapterFile ¶
func NewAdapterMemcached ¶
NewAdapterRedis creates and returns a new memory cache object.
func NewAdapterRedis ¶
Types ¶
type AdapterElasticsearch ¶
type AdapterElasticsearch struct {
// contains filtered or unexported fields
}
func (AdapterElasticsearch) Contains ¶
func (a AdapterElasticsearch) Contains(ctx context.Context, key interface{}) (bool, error)
func (AdapterElasticsearch) Data ¶
func (a AdapterElasticsearch) Data(ctx context.Context) (data map[interface{}]interface{}, err error)
func (AdapterElasticsearch) GetOrSetFunc ¶
func (AdapterElasticsearch) GetOrSetFuncLock ¶
func (AdapterElasticsearch) Keys ¶
func (a AdapterElasticsearch) Keys(ctx context.Context) (keys []interface{}, err error)
func (AdapterElasticsearch) SetIfNotExist ¶
func (AdapterElasticsearch) SetIfNotExistFunc ¶
func (AdapterElasticsearch) SetIfNotExistFuncLock ¶
func (AdapterElasticsearch) Size ¶
func (a AdapterElasticsearch) Size(ctx context.Context) (size int, err error)
func (AdapterElasticsearch) UpdateExpire ¶
type AdapterFile ¶
func (*AdapterFile) AddIndex ¶ added in v1.2.27
func (a *AdapterFile) AddIndex(FileName interface{}, duration time.Duration)
func (*AdapterFile) Contains ¶
func (a *AdapterFile) Contains(ctx context.Context, key interface{}) (bool, error)
func (*AdapterFile) Data ¶
func (a *AdapterFile) Data(ctx context.Context) (data map[interface{}]interface{}, err error)
func (*AdapterFile) DelIndex ¶ added in v1.2.27
func (a *AdapterFile) DelIndex(FileName interface{})
func (*AdapterFile) GetOrSetFunc ¶
func (*AdapterFile) GetOrSetFuncLock ¶
func (*AdapterFile) Key2Name ¶ added in v1.2.27
func (a *AdapterFile) Key2Name(key interface{}) string
func (*AdapterFile) Keys ¶
func (a *AdapterFile) Keys(ctx context.Context) (keys []interface{}, err error)
func (*AdapterFile) SetIfNotExist ¶
func (*AdapterFile) SetIfNotExistFunc ¶
func (*AdapterFile) SetIfNotExistFuncLock ¶
func (*AdapterFile) UpdateExpire ¶
type AdapterMemcached ¶
type AdapterMemcached struct {
}
AdapterRedis is the gcache adapter implements using Redis server.
func (AdapterMemcached) Contains ¶
func (a AdapterMemcached) Contains(ctx context.Context, key interface{}) (bool, error)
func (AdapterMemcached) Data ¶
func (a AdapterMemcached) Data(ctx context.Context) (data map[interface{}]interface{}, err error)
func (AdapterMemcached) GetOrSetFunc ¶
func (AdapterMemcached) GetOrSetFuncLock ¶
func (AdapterMemcached) Keys ¶
func (a AdapterMemcached) Keys(ctx context.Context) (keys []interface{}, err error)
func (AdapterMemcached) SetIfNotExist ¶
func (AdapterMemcached) SetIfNotExistFunc ¶
func (AdapterMemcached) SetIfNotExistFuncLock ¶
func (AdapterMemcached) Size ¶
func (a AdapterMemcached) Size(ctx context.Context) (size int, err error)
func (AdapterMemcached) UpdateExpire ¶
Click to show internal directories.
Click to hide internal directories.