Documentation ¶ Index ¶ Variables type Config type Memory func New[K comparable, V any](cfg Config) (*Memory[K, V], error) 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 ¶ This section is empty. Types ¶ type Config ¶ type Config struct { MaxItems int TTL time.Duration } type Memory ¶ type Memory[K comparable, V any] struct { // contains filtered or unexported fields } func New ¶ func New[K comparable, V any](cfg Config) (*Memory[K, V], error) 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.