drive

package
v1.3.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAdapterElasticsearch

func NewAdapterElasticsearch(name string) gcache.Adapter

func NewAdapterFile

func NewAdapterFile(filePath string) gcache.Adapter

func NewAdapterMemcached

func NewAdapterMemcached(redis *gredis.Redis) gcache.Adapter

NewAdapterRedis creates and returns a new memory cache object.

func NewAdapterMemory

func NewAdapterMemory() gcache.Adapter

NewAdapterMemory 创建并返回一个新的内存缓存对象。

func NewAdapterRedis

func NewAdapterRedis(name string) gcache.Adapter

Types

type AdapterElasticsearch

type AdapterElasticsearch struct {
	// contains filtered or unexported fields
}

func (AdapterElasticsearch) Clear

func (AdapterElasticsearch) Close

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) Get

func (a AdapterElasticsearch) Get(ctx context.Context, key interface{}) (res *gvar.Var, err error)

func (AdapterElasticsearch) GetExpire

func (a AdapterElasticsearch) GetExpire(ctx context.Context, key interface{}) (time.Duration, error)

func (AdapterElasticsearch) GetOrSet

func (a AdapterElasticsearch) GetOrSet(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (result *gvar.Var, err error)

func (AdapterElasticsearch) GetOrSetFunc

func (a AdapterElasticsearch) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)

func (AdapterElasticsearch) GetOrSetFuncLock

func (a AdapterElasticsearch) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)

func (AdapterElasticsearch) Keys

func (a AdapterElasticsearch) Keys(ctx context.Context) (keys []interface{}, err error)

func (AdapterElasticsearch) Remove

func (a AdapterElasticsearch) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error)

func (AdapterElasticsearch) Set

func (a AdapterElasticsearch) Set(ctx context.Context, _key interface{}, value interface{}, duration time.Duration) (err error)

func (AdapterElasticsearch) SetIfNotExist

func (a AdapterElasticsearch) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (ok bool, err error)

func (AdapterElasticsearch) SetIfNotExistFunc

func (a AdapterElasticsearch) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)

func (AdapterElasticsearch) SetIfNotExistFuncLock

func (a AdapterElasticsearch) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)

func (AdapterElasticsearch) SetMap

func (a AdapterElasticsearch) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) error

func (AdapterElasticsearch) Size

func (a AdapterElasticsearch) Size(ctx context.Context) (size int, err error)

func (AdapterElasticsearch) Update

func (a AdapterElasticsearch) Update(ctx context.Context, _key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error)

func (AdapterElasticsearch) UpdateExpire

func (a AdapterElasticsearch) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error)

func (AdapterElasticsearch) Values

func (a AdapterElasticsearch) Values(ctx context.Context) (values []interface{}, err error)

type AdapterFile

type AdapterFile struct {
	FilePath string
	Lock     sync.Mutex
}

func (*AdapterFile) AddIndex added in v1.2.27

func (a *AdapterFile) AddIndex(FileName interface{}, duration time.Duration)

func (*AdapterFile) Clear

func (a *AdapterFile) Clear(ctx context.Context) error

func (*AdapterFile) Close

func (a *AdapterFile) Close(ctx context.Context) error

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) Get

func (a *AdapterFile) Get(ctx context.Context, key interface{}) (res *gvar.Var, err error)

func (*AdapterFile) GetExpire

func (a *AdapterFile) GetExpire(ctx context.Context, key interface{}) (time.Duration, error)

func (*AdapterFile) GetOrSet

func (a *AdapterFile) GetOrSet(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (result *gvar.Var, err error)

func (*AdapterFile) GetOrSetFunc

func (a *AdapterFile) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)

func (*AdapterFile) GetOrSetFuncLock

func (a *AdapterFile) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)

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) Remove

func (a *AdapterFile) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error)

func (*AdapterFile) Set

func (a *AdapterFile) Set(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (err error)

func (*AdapterFile) SetIfNotExist

func (a *AdapterFile) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (ok bool, err error)

func (*AdapterFile) SetIfNotExistFunc

func (a *AdapterFile) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)

func (*AdapterFile) SetIfNotExistFuncLock

func (a *AdapterFile) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)

func (*AdapterFile) SetMap

func (a *AdapterFile) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) (err error)

func (*AdapterFile) Size

func (a *AdapterFile) Size(ctx context.Context) (size int, err error)

func (*AdapterFile) Update

func (a *AdapterFile) Update(ctx context.Context, key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error)

func (*AdapterFile) UpdateExpire

func (a *AdapterFile) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error)

func (*AdapterFile) Values

func (a *AdapterFile) Values(ctx context.Context) (values []interface{}, err error)

type AdapterMemcached

type AdapterMemcached struct {
}

AdapterRedis is the gcache adapter implements using Redis server.

func (AdapterMemcached) Clear

func (a AdapterMemcached) Clear(ctx context.Context) error

func (AdapterMemcached) Close

func (a AdapterMemcached) Close(ctx context.Context) error

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) Get

func (a AdapterMemcached) Get(ctx context.Context, key interface{}) (*gvar.Var, error)

func (AdapterMemcached) GetExpire

func (a AdapterMemcached) GetExpire(ctx context.Context, key interface{}) (time.Duration, error)

func (AdapterMemcached) GetOrSet

func (a AdapterMemcached) GetOrSet(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (result *gvar.Var, err error)

func (AdapterMemcached) GetOrSetFunc

func (a AdapterMemcached) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)

func (AdapterMemcached) GetOrSetFuncLock

func (a AdapterMemcached) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (result *gvar.Var, err error)

func (AdapterMemcached) Keys

func (a AdapterMemcached) Keys(ctx context.Context) (keys []interface{}, err error)

func (AdapterMemcached) Remove

func (a AdapterMemcached) Remove(ctx context.Context, keys ...interface{}) (lastValue *gvar.Var, err error)

func (AdapterMemcached) Set

func (a AdapterMemcached) Set(ctx context.Context, key interface{}, value interface{}, duration time.Duration) error

func (AdapterMemcached) SetIfNotExist

func (a AdapterMemcached) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (ok bool, err error)

func (AdapterMemcached) SetIfNotExistFunc

func (a AdapterMemcached) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)

func (AdapterMemcached) SetIfNotExistFuncLock

func (a AdapterMemcached) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (ok bool, err error)

func (AdapterMemcached) SetMap

func (a AdapterMemcached) SetMap(ctx context.Context, data map[interface{}]interface{}, duration time.Duration) error

func (AdapterMemcached) Size

func (a AdapterMemcached) Size(ctx context.Context) (size int, err error)

func (AdapterMemcached) Update

func (a AdapterMemcached) Update(ctx context.Context, key interface{}, value interface{}) (oldValue *gvar.Var, exist bool, err error)

func (AdapterMemcached) UpdateExpire

func (a AdapterMemcached) UpdateExpire(ctx context.Context, key interface{}, duration time.Duration) (oldDuration time.Duration, err error)

func (AdapterMemcached) Values

func (a AdapterMemcached) Values(ctx context.Context) (values []interface{}, err error)

type FileData added in v1.2.27

type FileData struct {
	Data interface{} `json:"data"`
	Time int64       `json:"time"`
}

type FileIndex added in v1.2.27

type FileIndex struct {
	File     string        `json:"file"`
	Duration time.Duration `json:"duration"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL