Documentation ¶
Overview ¶
Package cache implements cache storage.
Index ¶
- type Config
- type Storage
- func (store Storage) GetData(id string) (*gen.ItemData, error)
- func (store Storage) GetMeta(id string) (*gen.ItemMeta, error)
- func (store Storage) Items(owner string) (*gen.ItemList, error)
- func (store Storage) SetItem(owner string, req *gen.NewItemRequest) (*ulid.ULID, error)
- func (store Storage) Stats(owner string) (*gen.StatsResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MetaTTL time.Duration `default:"240h" description:"Metadata TTL" long:"meta_ttl"` DataTTL time.Duration `default:"24h" description:"Data TTL" long:"data_ttl"` CleanupInterval time.Duration `default:"10m" description:"Cleanup interval" long:"cleanup"` }
Config holds Storage Config.
type Storage ¶
type Storage struct { Meta *zcache.Cache[string, *gen.ItemMeta] Data *zcache.Cache[string, string] DataTTL time.Duration }
Storage implements data storage.
Click to show internal directories.
Click to hide internal directories.