Documentation
¶
Overview ¶
Package cache provides abstractions to allow the creation of concrete implementations.
Index ¶
- func ObserveEviction(ctx context.Context, attrs ...attribute.KeyValue)
- func ObserveHit(ctx context.Context, attrs ...attribute.KeyValue)
- func ObserveMiss(ctx context.Context, attrs ...attribute.KeyValue)
- func SetupMetricsOnce()
- func UseCaseAttribute(useCase string) attribute.KeyValue
- type Cache
- type TTLCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ObserveEviction ¶ added in v0.74.0
func ObserveHit ¶ added in v0.74.0
ObserveHit increments the cache hit counter.
func ObserveMiss ¶ added in v0.74.0
ObserveMiss increments the cache miss counter.
func SetupMetricsOnce ¶ added in v0.74.0
func SetupMetricsOnce()
SetupMetricsOnce initializes the cache counter.
func UseCaseAttribute ¶ added in v0.74.0
UseCaseAttribute returns an attribute.KeyValue with the use case.
Types ¶
type Cache ¶
type Cache interface { // Get a value based on a specific key. The call returns whether the key exists or not. Get(ctx context.Context, key string) (interface{}, bool, error) // Purge the cache. Purge(ctx context.Context) error // Remove the key from the cache. Remove(ctx context.Context, key string) error // Set the value for the specified key. Set(ctx context.Context, key string, value interface{}) error }
Cache interface that defines the methods required.
Click to show internal directories.
Click to hide internal directories.