Documentation ¶
Index ¶
- Constants
- func CreateTwigTTL(ttl time.Duration) (twig.Key, []byte, error)
- func ExpirationData(node forest.Node) (hasExpired, canExpire bool, err error)
- func ExpiresAt(node forest.Node) (time.Time, error)
- func IsExpired(node forest.Node) (bool, error)
- func TTLKey() twig.Key
- func UnmarshalTTL(data []byte) (time.Time, error)
- type ExpiredPurger
Constants ¶
const (
TTLKeyName = "expiration"
)
Variables ¶
This section is empty.
Functions ¶
func ExpirationData ¶
ExpirationData checks for the presence of an expiration metadata extension as well as whether the node has expired. The first return value will be true if the node has a set expiration in the past. The second return value will be true if there is an expiration date set. Any errors in parsing the data will be returned as the final value.
func ExpiresAt ¶
ExpiresAt returns the time at which the node expires, if any. If no expiration date is set, it will return the zero value for a time.Time.
Types ¶
type ExpiredPurger ¶
ExpiredPurger provides automation to periodically remove expired nodes from a store.
func (ExpiredPurger) Start ¶
func (e ExpiredPurger) Start(done <-chan struct{})
Start launches the ExpiredPurger. It will perform an immediate purge, and then will do anther after each e.PurgeInterval. It will shut down when the done channel closes.