Versions in this module Expand all Collapse all v1 v1.0.0 Jan 17, 2024 Changes in this version + var ErrInvalidKey = fmt.Errorf("key is invalid") + var ErrTooBigKey = fmt.Errorf("key was too big, must not be greater than 63k") + type Cache struct + func New(options ...Option) (cache *Cache) + func (c *Cache) Contains(k []byte) bool + func (c *Cache) Expire(k []byte, ttl time.Duration) + func (c *Cache) Get(k []byte) (p []byte, ok bool) + func (c *Cache) Remove(k []byte) + func (c *Cache) Set(k []byte, v []byte) (err error) + func (c *Cache) SetWithTTL(k []byte, v []byte, ttl time.Duration) (err error) + type Entries []Entry + func MakeEntries(k []byte, p []byte, ttl time.Duration, hash Hash) (entries Entries) + func (entries Entries) Deadline() time.Time + func (entries Entries) Value() (p []byte) + type Entry struct + func (kv Entry) Hash() uint64 + func (kv Entry) Key() []byte + func (kv Entry) Value() Value + type Hash interface + Sum func(p []byte) (h uint64) + type MemHash struct + func (hash MemHash) Sum(p []byte) (h uint64) + type Option func(opt *Options) + func MaxBytes(n uint64) Option + func WithHash(h Hash) Option + type Options struct + type Value []byte + func (v Value) BigKey() bool + func (v Value) Bytes() (p []byte) + func (v Value) Deadline() time.Time + func (v Value) Normal() bool + func (v Value) Pos() int + func (v Value) SetDeadline(deadline time.Time) + func (v Value) Size() int