cache

package
v1.7.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Caches      = []gcache.Cache{}
	CacheNames  []string
	CacheConfig = []CacheCfg{}
)

Functions

func CacheInit

func CacheInit(cfg CacheCfg, logger log.FieldLogger) error

func GetKey

func GetKey(cacheName string, key string) (string, error)

func SetKey

func SetKey(cacheName string, key string, value string, expiration *time.Duration) error

func UpdateCacheMetrics

func UpdateCacheMetrics()

UpdateCacheMetrics is called directly by the prom handler

Types

type CacheCfg

type CacheCfg struct {
	Name     string
	Size     int
	TTL      time.Duration
	Strategy string
	LogLevel log.Level
	Logger   log.FieldLogger
}

func (CacheCfg) NewLogger added in v1.7.4

func (cfg CacheCfg) NewLogger() *log.Entry

Jump to

Keyboard shortcuts

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