cache

package
v1.5.17 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheConfig []CacheCfg
View Source
var CacheMetrics = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Name: "cs_cache_size",
		Help: "Entries per cache.",
	},
	[]string{"name", "type"},
)

prometheus

View Source
var CacheNames []string
View Source
var Caches []gcache.Cache

Functions

func CacheInit

func CacheInit(cfg CacheCfg) 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.Entry
}

Jump to

Keyboard shortcuts

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