Documentation ¶
Overview ¶
Package flowtrack contains types for tracking TCP/UDP flows by 4-tuples.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { // MaxEntries is the maximum number of cache entries before // an item is evicted. Zero means no limit. MaxEntries int // contains filtered or unexported fields }
Cache is an LRU cache keyed by Tuple.
The zero value is valid to use.
It is not safe for concurrent access.
func (*Cache) Add ¶
Add adds a value to the cache, set or updating its associated value.
If MaxEntries is non-zero and the length of the cache is greater after any addition, the least recently used value is evicted.
func (*Cache) Get ¶
Get looks up a key's value from the cache, also reporting whether it was present.
func (*Cache) RemoveOldest ¶
func (c *Cache) RemoveOldest()
RemoveOldest removes the oldest item from the cache, if any.
Click to show internal directories.
Click to hide internal directories.