Versions in this module Expand all Collapse all v0 v0.1.1 Feb 2, 2024 v0.1.0 Jan 8, 2024 Changes in this version + var ErrEntryNotFound = errors.New("entry is not found") + var ErrEntryTooBig = errors.New("entry is too big") + type Cache interface + Delete func(ctx context.Context, key string) ([]byte, error) + Get func(ctx context.Context, key string) ([]byte, error) + Name func() string + Set func(ctx context.Context, key string, entry []byte) error + func MustNewFile(ctx context.Context) Cache + func MustNewFileWithConfig(ctx context.Context, cfg FileConfig) Cache + func MustNewMemory(ctx context.Context) Cache + func MustNewMemoryWithConfig(ctx context.Context, cfg MemoryConfig) Cache + func NewFile(ctx context.Context) (Cache, error) + func NewFileWithConfig(ctx context.Context, cfg FileConfig) (Cache, error) + func NewMemory(ctx context.Context) (Cache, error) + func NewMemoryWithConfig(ctx context.Context, cfg MemoryConfig) (Cache, error) + func WithSingleFlight(c Cache) Cache + type FileConfig struct + Buckets int + EntryMaxAge time.Duration + LazyEntryEviction bool + Namespace string + func (c *FileConfig) Default() + func (c *FileConfig) Validate() error + type MemoryConfig struct + BucketCapacity int + Buckets int + EntryMaxAge time.Duration + LazyBucketCapacityScale bool + LazyEntryEviction bool + Namespace string + func (c *MemoryConfig) Default() + func (c *MemoryConfig) Validate() error