Documentation
¶
Index ¶
- Variables
- type Cache
- func (c *Cache) Add(key string, cur uint64, val []byte)
- func (c *Cache) First() (cur uint64, val []byte)
- func (c *Cache) Iter(key string) iter.Seq2[uint64, []byte]
- func (c *Cache) IterAfter(key string, cur uint64) iter.Seq2[uint64, []byte]
- func (c *Cache) Last() (cur uint64, val []byte)
- func (c *Cache) Len() int
- func (c *Cache) Resize(maxBytes int)
- func (c *Cache) Size() int
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// DefaultMaxSizeBytes sets the default max size at 256 MiB
DefaultMaxSizeBytes = 256 << 20
)
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache implements a multi value FIFO cache.
func (*Cache) IterAfter ¶
IterAfter returns an iterator over the cache at a certain key after a specific cursor. Complexity is O(2n). We iterate backward over the list then forward to optimize for access to later values.
Click to show internal directories.
Click to hide internal directories.