Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Hit is a counter for cache hits. Hit = metrics.MustInt64(). Counter( prometheus.BuildFQName(namespace, subsystem, "hit"), metric.WithDescription("The number of cache hits"), ) // Miss is a counter for cache misses. Miss = metrics.MustInt64(). Counter( prometheus.BuildFQName(namespace, subsystem, "miss"), metric.WithDescription("The number of cache misses"), ) // Error is a counter for cache errors. Error = metrics.MustInt64(). Counter( prometheus.BuildFQName(namespace, subsystem, "error"), metric.WithDescription("The number of times an error occurred reading or writing to the cache"), ) )
Functions ¶
Types ¶
type Cacher ¶
type Cacher interface { // Get retrieves a value from the cache, the bool indicates if the item was found Get(ctx context.Context, key string) ([]byte, bool, error) // Set sets a value in the cache Set(ctx context.Context, key string, value []byte) error // Delete removes a value from the cache Delete(ctx context.Context, key string) error fmt.Stringer }
Cacher modifies and queries a cache
Click to show internal directories.
Click to hide internal directories.