Documentation ¶
Overview ¶
Common methods for Expiry packages
Common methods for Expiry packages
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Expiry ¶
type Expiry struct { Clock clock // contains filtered or unexported fields }
Handles tracking of expiration times. This is intentionally _not_ an interface The way the Expiry packages implement this is unique
func (*Expiry) NewExpiryRecordTTL ¶
func (e *Expiry) NewExpiryRecordTTL(key string, ttl time.Duration) ExpiryRecord
type ExpiryRecord ¶
type ExpiryRecord struct { Key string // An unsigned int32 is good until 2100... Expiry tinytime.TinyTime }
ExpiryRecord is an efficient way to encode the Expiry time in a uint32
func NewExpiryRecord ¶
func NewExpiryRecord(key string, expires time.Time) ExpiryRecord
func NewExpiryRecordTTL ¶
func NewExpiryRecordTTL(key string, clock clock, ttl time.Duration) ExpiryRecord
func (ExpiryRecord) HasExpired ¶
func (r ExpiryRecord) HasExpired(now time.Time) bool
HasExpired uses the given time.Time to determine if the key is valid
func (ExpiryRecord) HasExpiry ¶
func (r ExpiryRecord) HasExpiry() bool
HasExpiry determines where the key has an expiry value
Directories ¶
Path | Synopsis |
---|---|
memory is a thread safe library for handling TTL of keys as an expiry solution, `memory` is only suitable of in-memory store as the exoiry records do not persist
|
memory is a thread safe library for handling TTL of keys as an expiry solution, `memory` is only suitable of in-memory store as the exoiry records do not persist |
Implement expiry within the the actual value storage The underlying store will need to use this when Inserting/Retrieving
|
Implement expiry within the the actual value storage The underlying store will need to use this when Inserting/Retrieving |
Click to show internal directories.
Click to hide internal directories.