utilCache

package
v0.0.0-...-84a02b8 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 5 Imported by: 1

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 NewCache

func NewCache(keyPrefix string, expire time.Duration) *Cache

func (*Cache) ClearAll

func (c *Cache) ClearAll()

func (*Cache) Close

func (c *Cache) Close()

func (*Cache) Del

func (c *Cache) Del(key string) error

Del value by key

func (*Cache) DelMulti

func (c *Cache) DelMulti(keys []string) error

DelMulti values by keys

func (*Cache) Get

func (c *Cache) Get(key string) interface{}

Get value by key

func (*Cache) GetBool

func (c *Cache) GetBool(key string) (v bool)

func (*Cache) GetInt

func (c *Cache) GetInt(key string) (v int, ok bool)

func (*Cache) GetInt64

func (c *Cache) GetInt64(key string) (v int64, ok bool)

func (*Cache) GetMulti

func (c *Cache) GetMulti(keys []string) map[string]interface{}

GetMulti values by keys

func (*Cache) GetString

func (c *Cache) GetString(key string) (v string, ok bool)

func (*Cache) Has

func (c *Cache) Has(key string) bool

Has cache key

func (*Cache) RegisterStoreFile

func (c *Cache) RegisterStoreFile(dir string) *Cache

func (*Cache) RegisterStoreMemory

func (c *Cache) RegisterStoreMemory(size int) *Cache

func (*Cache) RegisterStoreRedis

func (c *Cache) RegisterStoreRedis(addr, pwd string, dbNum int) *Cache

func (*Cache) RegisterStoreRedisWithClient

func (c *Cache) RegisterStoreRedisWithClient(rc *utilRedis.RedisClient) *Cache

func (*Cache) Set

func (c *Cache) Set(key string, val interface{}, ttl ...time.Duration) error

Set value by key

func (*Cache) SetExpire

func (c *Cache) SetExpire(ttl time.Duration) *Cache

func (*Cache) SetMulti

func (c *Cache) SetMulti(mv map[string]interface{}, ttl ...time.Duration) error

SetMulti values

Jump to

Keyboard shortcuts

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