cache

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 6 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache interface {
	SaveObj(i dao.CacheObj, exp time.Duration) error
	GetObj(key string, i dao.CacheObj) error
	GetObjs(keys []string, d dao.CacheObj) (objs []dao.CacheObj, err error)
	SaveObjHash(i dao.CacheMapObj, exp time.Duration) error
	GetObjHash(key string, i dao.CacheMapObj) error
}

func NewRedisCache

func NewRedisCache(clt db.RedisClient) Cache

type SimpleCache

type SimpleCache interface {
	Save() (string, error)
	Get() ([]byte, error)
	SetData(d SimpleCacheData)
}

func NewCache

func NewCache(data SimpleCacheData, db db.RedisClient) SimpleCache

type SimpleCacheData

type SimpleCacheData interface {
	GetKey() string
	GetData() ([]byte, error)
	Expired() time.Duration
}

Jump to

Keyboard shortcuts

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