cache

package
v0.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: MIT Imports: 5 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 {
	BigCache *bigcache.BigCache
}

func NewCache

func NewCache(expTime time.Duration) (*Cache, error)

NewCache 初始化带时间过期的缓存,0为永不过期

func (*Cache) Close

func (i *Cache) Close() error

Close 关闭缓存

func (*Cache) Delete

func (i *Cache) Delete(key string) error

Delete 删除

func (*Cache) Get

func (i *Cache) Get(key string, v any) error

Get 传入key 和 v指针,返回相应类型

func (*Cache) Len

func (i *Cache) Len() int

Len 当前缓存长度

func (*Cache) Reset

func (i *Cache) Reset() error

Reset 重置缓存

func (*Cache) Set

func (i *Cache) Set(key string, value any) error

Set 将指定的key存储到缓存中

Jump to

Keyboard shortcuts

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