Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
// Close closes the cache's garbage collector
Closer
// Len returns the length of the queue
LengthCheck
// Get gets an item from the cache by key
Get(key interface{}) (interface{}, bool)
// Exists returns true if the key exists in the cache
Exists(key interface{}) bool
// Set sets an item in the cache for the specified duration. If duration == 0, the item will never expire
Set(key interface{}, value interface{}, duration time.Duration)
// Range iterates over every item in the cache
Range(f func(key, value interface{}) bool)
// Delete deletes an item from the cache
Delete(key interface{})
}
Cache is a general purpose, concurrency-safe, in-memory cache data-structure
type LengthCheck ¶ added in v0.1.0
type LengthCheck interface {
Len() int
}
Len returns the length of a data-structure
type Queue ¶
type Queue interface {
// Enqueue adds a new node to the tail of the queue
Enqueue(value interface{})
// Dequeue removes the head node from the queue and returns it
Dequeue() interface{}
// Len returns the length of the queue
LengthCheck
}
Queue is a general purpose, in-memory queue data-structure
Click to show internal directories.
Click to hide internal directories.