Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("key: not found")
)
Functions ¶
This section is empty.
Types ¶
type ValueRecord ¶
type ValueRecord struct { AddedAt int64 // When was the record added TTL int64 // The time to live of the record TTLUnit time.Duration // Duration multiplier // contains filtered or unexported fields }
func NewValueRecord ¶
func (*ValueRecord) HasExpired ¶
func (vr *ValueRecord) HasExpired() bool
type ValueStore ¶
type ValueStore struct { KVStore map[string]*ValueRecord // The backing datastore // contains filtered or unexported fields }
func NewValueStore ¶
func NewValueStore(ttl int64, ttlUnit time.Duration) *ValueStore
func (*ValueStore) PruneOld ¶
func (vs *ValueStore) PruneOld()
func (*ValueStore) PruneWorker ¶
func (vs *ValueStore) PruneWorker()
Click to show internal directories.
Click to hide internal directories.