CoreCache

package
v5.2.18 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//CacheTime6Sec 6秒过期时间
	CacheTime6Sec = 6
	//CacheTime1Minutes 1分钟过期时间
	CacheTime1Minutes = 60
	//CacheTime1Hour 1小时过期时间
	CacheTime1Hour = 3600
	//CacheTime1Day 1天过期时间
	CacheTime1Day = CacheTime1Hour * 24
	//CacheTime2Day 2天过期时间
	CacheTime2Day = CacheTime1Day * 2
	//CacheTime3Day 3天过期时间
	CacheTime3Day = CacheTime1Day * 3
	//CacheTime1Week 1周过期时间
	CacheTime1Week = CacheTime1Day * 7
	//CacheTime1Month 1个月过期时间
	CacheTime1Month = CacheTime1Day * 30
	//CacheTime1Year 一年过期时间
	CacheTime1Year = CacheTime1Month * 12
)

Functions

This section is empty.

Types

type CacheData

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

func (*CacheData) AppendList

func (t *CacheData) AppendList(key string, data ...any)

AppendList 向列表末尾插入数据

func (*CacheData) DeleteAll

func (t *CacheData) DeleteAll()

DeleteAll 清理所有数据

func (*CacheData) DeleteListFirst

func (t *CacheData) DeleteListFirst(key string)

DeleteListFirst 删除列表第一条数据

func (*CacheData) DeleteMark

func (t *CacheData) DeleteMark(mark string)

func (*CacheData) DeleteSearchMark

func (t *CacheData) DeleteSearchMark(mark string)

func (*CacheData) FindKeys

func (t *CacheData) FindKeys(mark string) (data []string, err error)

func (*CacheData) GetBool

func (t *CacheData) GetBool(mark string) (data bool, err error)

func (*CacheData) GetByte

func (t *CacheData) GetByte(mark string) (data []byte, err error)

func (*CacheData) GetFloat64

func (t *CacheData) GetFloat64(mark string) (data float64, err error)

func (*CacheData) GetInt

func (t *CacheData) GetInt(mark string) (data int, err error)

func (*CacheData) GetInt64

func (t *CacheData) GetInt64(mark string) (data int64, err error)

func (*CacheData) GetListAll

func (t *CacheData) GetListAll(key string, data any) (err error)

GetListAll 获取列表所有数据

func (*CacheData) GetListLen

func (t *CacheData) GetListLen(key string) (count int, err error)

GetListLen 获取列表长度

func (*CacheData) GetRedisDB

func (t *CacheData) GetRedisDB() (db *redis.Pool)

GetRedisDB 获取缓冲redis数据库原始数据

func (*CacheData) GetScanStruct

func (t *CacheData) GetScanStruct(mark string, data []any) (err error)

func (*CacheData) GetString

func (t *CacheData) GetString(mark string) (data string, err error)

GetString 读取数据

func (*CacheData) GetStruct

func (t *CacheData) GetStruct(mark string, data interface{}) (err error)

func (*CacheData) Init

func (t *CacheData) Init(setMode string)

func (*CacheData) InitRedis

func (t *CacheData) InitRedis(url string, password string, num int) (err error)

InitRedis 连接服务

func (*CacheData) SetAny

func (t *CacheData) SetAny(mark string, val any, expire int)

func (*CacheData) SetBool

func (t *CacheData) SetBool(mark string, val bool, expire int)

func (*CacheData) SetInt

func (t *CacheData) SetInt(mark string, val int, expire int)

func (*CacheData) SetInt64

func (t *CacheData) SetInt64(mark string, val int64, expire int)

func (*CacheData) SetString

func (t *CacheData) SetString(mark string, val string, expire int)

SetString 写入数据

func (*CacheData) SetStruct

func (t *CacheData) SetStruct(mark string, val any, expire int)

Jump to

Keyboard shortcuts

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