Documentation ¶
Overview ¶
Package cache implements generic cache used throughout this application. By default it persists values to disk cache (using BadgerDB). Mainly the cache is used for STS Temporary Session Credentials and Yubikey OATH Application Password caching.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶ added in v0.11.0
type Cache struct {
// contains filtered or unexported fields
}
Cache struct is used to define all the high-level repository methods, that internally call the low-level (disk cache) repository (which has the same interface to interact with BadgerDB).
func (*Cache) DeleteByPrefix ¶ added in v0.12.10
DeleteByPrefix clears all values with key prefix from cache.
type Repository ¶ added in v0.12.10
type Repository interface { Write(key string, value []byte, ttl time.Duration) error Read(key string) ([]byte, error) Delete(key string) error DeleteByPrefix(keyPrefix string) error DeleteAll() error Close() error }
Repository interface defines the methods that any cache implementation must implement.
Click to show internal directories.
Click to hide internal directories.