Versions in this module Expand all Collapse all v0 v0.1.2 Oct 12, 2021 Changes in this version + var ErrInvalidExpiration = errors.New("memo: invalid expiration") + var ErrNotFound = errors.New("memo: not found") + type Clock interface + Now func() int64 + type GetOption func(*getOptions) + func GetWithExpiration(expiration time.Duration) GetOption + func GetWithLoader(loader Loader) GetOption + type Key = interface + type Loader func(Key) (Value, error) + type Memo struct + func New(opts ...Option) *Memo + func (m *Memo) Del(k Key) + func (m *Memo) Get(k Key, opts ...GetOption) (Value, error) + func (m *Memo) Set(k Key, v Value, opts ...SetOption) + type Option func(*options) + func WithClock(clock Clock) Option + func WithExpiration(expiration time.Duration) Option + func WithLoader(loader Loader) Option + type RealClock struct + func NewRealClock() RealClock + func (rc RealClock) Now() int64 + type SetOption func(*setOptions) + func SetWithExpiration(expiration time.Duration) SetOption + type Value = interface