Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // Increment increases the count associated with the key by 1. // If the key doesn't exist, it is created with count of 1. Increment(key interface{}) // Decrement decreases the count associated with the key by 1. // If the key doesn't exist, the result is no operation. // If as a result, the count drops to zero, it is removed. // Counts can never become negative hence the 'uint'. Decrement(key interface{}) // Count returns the current count of the given key. // If the key does not exist, zero is returned. Count(key interface{}) uint // Max deterministically returns the key with the highest count. // Of the keys sharing the same maximum count, the oldest of them is returned. Max() (interface{}, uint) // Min deterministically returns the key with the lowest non-zero count. // Of the keys sharing the same minimum count, the newest of them is returned. Min() (interface{}, uint) }
Interface represents all permitted operations that run in O(1) time: constant time operations.
Click to show internal directories.
Click to hide internal directories.