Documentation ¶
Index ¶
- type Cache
- type CacheParams
- type Config
- type NoopCache
- func (*NoopCache) Close()
- func (*NoopCache) Del(_ any)
- func (*NoopCache) Get(_ any) (any, bool)
- func (*NoopCache) GetTTL(_ any) (time.Duration, bool)
- func (*NoopCache) Hits() uint64
- func (*NoopCache) Misses() uint64
- func (*NoopCache) Set(_, _ any, _ int64) bool
- func (*NoopCache) SetWithTTL(_, _ any, _ int64, _ time.Duration) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶ added in v1.143.0
type Cache interface { Get(key any) (any, bool) Set(key, value any, cost int64) bool SetWithTTL(key, value any, cost int64, ttl time.Duration) bool Del(key any) GetTTL(key any) (time.Duration, bool) Close() Hits() uint64 Misses() uint64 }
Cache for ristretto.
type CacheParams ¶ added in v1.65.0
CacheParams for ristretto.
type Config ¶
type Config struct { NumCounters int64 `yaml:"num_counters,omitempty" json:"num_counters,omitempty" toml:"num_counters,omitempty"` MaxCost int64 `yaml:"max_cost,omitempty" json:"max_cost,omitempty" toml:"max_cost,omitempty"` BufferItems int64 `yaml:"buffer_items,omitempty" json:"buffer_items,omitempty" toml:"buffer_items,omitempty"` }
Config for ristretto.
Click to show internal directories.
Click to hide internal directories.