cache

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

func New

func New(lruCap ...int) *Cache

func (*Cache) Clear

func (c *Cache) Clear(ctx context.Context) error

func (*Cache) Close

func (c *Cache) Close(ctx context.Context) error

func (*Cache) Contains

func (c *Cache) Contains(ctx context.Context, key interface{}) (bool, error)

func (*Cache) ContainsKey

func (c *Cache) ContainsKey(ctx context.Context, key interface{}) bool

func (*Cache) Data

func (c *Cache) Data(ctx context.Context) (map[interface{}]interface{}, error)

func (*Cache) Get

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

func (*Cache) GetExpire

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

func (*Cache) GetInt

func (c *Cache) GetInt(ctx context.Context, key interface{}) (int, error)

func (*Cache) GetMap

func (c *Cache) GetMap(ctx context.Context, key interface{}) (map[string]interface{}, error)

func (*Cache) GetMapStrStr

func (c *Cache) GetMapStrStr(ctx context.Context, key interface{}) (map[string]string, error)

func (*Cache) GetMapStrVar

func (c *Cache) GetMapStrVar(ctx context.Context, key interface{}) (map[string]*gvar.Var, error)

func (*Cache) GetOrSet

func (c *Cache) GetOrSet(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (*gvar.Var, error)

func (*Cache) GetOrSetFunc

func (c *Cache) GetOrSetFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (*gvar.Var, error)

func (*Cache) GetOrSetFuncLock

func (c *Cache) GetOrSetFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (*gvar.Var, error)

func (*Cache) GetStr

func (c *Cache) GetStr(ctx context.Context, key interface{}) (string, error)

func (*Cache) GetVal

func (c *Cache) GetVal(ctx context.Context, key interface{}) interface{}

func (*Cache) Keys

func (c *Cache) Keys(ctx context.Context) ([]interface{}, error)

func (*Cache) Remove

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

func (*Cache) Set

func (c *Cache) Set(ctx context.Context, key interface{}, value interface{}, duration time.Duration) error

func (*Cache) SetIfNotExist

func (c *Cache) SetIfNotExist(ctx context.Context, key interface{}, value interface{}, duration time.Duration) (bool, error)

func (*Cache) SetIfNotExistFunc

func (c *Cache) SetIfNotExistFunc(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (bool, error)

func (*Cache) SetIfNotExistFuncLock

func (c *Cache) SetIfNotExistFuncLock(ctx context.Context, key interface{}, f gcache.Func, duration time.Duration) (bool, error)

func (*Cache) SetMap

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

func (*Cache) Size

func (c *Cache) Size(ctx context.Context) (int, error)

func (*Cache) Update

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

func (*Cache) UpdateExpire

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

func (*Cache) Values

func (c *Cache) Values(ctx context.Context) ([]interface{}, error)

Jump to

Keyboard shortcuts

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