cache

package
v1.6.3-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2024 License: MIT Imports: 7 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

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

prometheus

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