cache

package
v2.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 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) 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) Increase

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

Increase value

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