Documentation ¶ Index ¶ Variables func Store[K comparable, V any](ctx context.Context, cfg Config) (cache.Cacher[K, V], error) type Config type Memory func (m *Memory[K, V]) Get(_ context.Context, key K) (V, bool, error) func (m *Memory[K, V]) Set(_ context.Context, key K, value V) error Constants ¶ This section is empty. Variables ¶ View Source var ( DefaultMaxItems = 1_000 DefaultTTL = 10 * time.Minute ) Functions ¶ func Store ¶ func Store[K comparable, V any](ctx context.Context, cfg Config) (cache.Cacher[K, V], error) Types ¶ type Config ¶ type Config struct { MaxItems int `cfg:"max_items" json:"max_items"` TTL time.Duration `cfg:"ttl" json:"ttl"` } type Memory ¶ type Memory[K comparable, V any] struct { // contains filtered or unexported fields } func (*Memory[K, V]) Get ¶ func (m *Memory[K, V]) Get(_ context.Context, key K) (V, bool, error) func (*Memory[K, V]) Set ¶ func (m *Memory[K, V]) Set(_ context.Context, key K, value V) error Source Files ¶ View all Source files memory.go Click to show internal directories. Click to hide internal directories.