Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PriorityQueue ¶
type PriorityQueue interface {
// Add adds an item to the priority queue with the given value and TTL
Add(key string, value interface{}, ttl time.Duration)
// Delete deletes the item with the given key from the priority queue
Delete(key string)
// DeleteExpired deletes all items from the priority queue that have
// expired based on their TTL
DeleteExpired(t time.Time) int
// Get returns the item for a given key and increases its TTL on
// retrieval
Get(key string, ttl time.Duration) interface{}
// Len returns the length of the priority queue
Len() int
}
PriorityQueue represents an interface to a priority queue for items with a Time-To-Live (TTL)
func NewPriorityQueue ¶
func NewPriorityQueue() PriorityQueue
NewPriorityQueue returns a new PriorityQueue
Click to show internal directories.
Click to hide internal directories.