cache

package
v2.0.91 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCache

func NewCache(prefix string, store cache.ICache) cache.ICache

NewCache 创建对应上下文缓存

Types

type Cache

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

func (*Cache) Connect

func (e *Cache) Connect() error

Connect 初始化

func (*Cache) Decrease

func (e *Cache) Decrease(ctx context.Context, key string) (int64, error)

func (*Cache) Del

func (e *Cache) Del(ctx context.Context, key string) error

Del delete key in cache

func (*Cache) Expire

func (e *Cache) Expire(ctx context.Context, key string, dur time.Duration) error

func (*Cache) Get

func (e *Cache) Get(ctx context.Context, key string) (*gvar.Var, error)

Get val in cache

func (*Cache) HashDel

func (e *Cache) HashDel(ctx context.Context, hk, key string) error

HashDel delete one key:value pair in hashtable cache

func (*Cache) HashGet

func (e *Cache) HashGet(ctx context.Context, hk, key string) (*gvar.Var, error)

HashGet get val in hashtable cache

func (*Cache) HashGetAll added in v2.0.32

func (e *Cache) HashGetAll(ctx context.Context, key string) (*gvar.Var, error)

func (*Cache) HashLen added in v2.0.32

func (e *Cache) HashLen(ctx context.Context, key string) (int64, error)

func (*Cache) HashMGet added in v2.0.37

func (e *Cache) HashMGet(ctx context.Context, key string, fields ...string) (gvar.Vars, error)

func (*Cache) HashMSet added in v2.0.37

func (e *Cache) HashMSet(ctx context.Context, key string, fields map[string]interface{}) error

func (*Cache) HashSet added in v2.0.32

func (e *Cache) HashSet(ctx context.Context, key string, fields map[string]interface{}) (int64, error)

func (*Cache) HashVals added in v2.0.68

func (e *Cache) HashVals(ctx context.Context, key string) (gvar.Vars, error)

func (*Cache) Increase

func (e *Cache) Increase(ctx context.Context, key string) (int64, error)

Increase value

func (*Cache) ListPush added in v2.0.70

func (e *Cache) ListPush(ctx context.Context, key string, values ...interface{}) (int64, error)

func (*Cache) ListRPop added in v2.0.70

func (e *Cache) ListRPop(ctx context.Context, key string, count ...int) (*gvar.Var, error)

func (*Cache) Set

func (e *Cache) Set(ctx context.Context, key string, val interface{}, expire int) error

Set val in cache

func (*Cache) SetPrefix

func (e *Cache) SetPrefix(prefix string)

SetPrefix 设置前缀

func (*Cache) String

func (e *Cache) String() string

String string输出

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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