Versions in this module Expand all Collapse all v0 v0.1.1 Nov 23, 2026 v0.1.0 Nov 14, 2026 Changes in this version + const MaxBytes + const MaxEntries + const MaxTime + type Budget struct + func NewBudget(limit int) (*Budget, error) + func (b *Budget) Release(size int) error + func (b *Budget) Reserve(size int) bool + func (b *Budget) Used() int + type Cache struct + func New[T any](capacity, bytes int) (*Cache[T], error) + func (c *Cache[T]) Bytes() int + func (c *Cache[T]) Clear() + func (c *Cache[T]) Delete(key string) bool + func (c *Cache[T]) Entries(now int64) ([]Entry[T], error) + func (c *Cache[T]) Get(key string, now int64) (T, bool) + func (c *Cache[T]) Len() int + func (c *Cache[T]) Peek(key string, now int64) (T, bool) + func (c *Cache[T]) Put(key string, value T, cost int, expires, now int64) ([]string, error) + func (c *Cache[T]) Trim(reserved int, now int64) ([]string, error) + type Entry struct + Cost int + Expires int64 + Key string + Value T + type Persistence struct + func NewPersistence[T any](backend managedstate.PrivateBackend) (*Persistence[T], error) + func (p *Persistence[T]) Flush(ctx context.Context, c *Cache[T], now int64) error + func (p *Persistence[T]) Load(ctx context.Context, c *Cache[T], now int64) error