Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FirstSeenCache ¶
type FirstSeenCache struct {
// contains filtered or unexported fields
}
FirstSeenCache is a time cache that only marks the expiry of a message when first added.
func (*FirstSeenCache) Add ¶
func (tc *FirstSeenCache) Add(s string) bool
func (*FirstSeenCache) Done ¶
func (tc *FirstSeenCache) Done()
func (*FirstSeenCache) Has ¶
func (tc *FirstSeenCache) Has(s string) bool
type LastSeenCache ¶
type LastSeenCache struct {
// contains filtered or unexported fields
}
LastSeenCache is a time cache that extends the expiry of a seen message when added or checked for presence with Has..
func (*LastSeenCache) Add ¶
func (tc *LastSeenCache) Add(s string) bool
func (*LastSeenCache) Done ¶
func (tc *LastSeenCache) Done()
func (*LastSeenCache) Has ¶
func (tc *LastSeenCache) Has(s string) bool
type TimeCache ¶
type TimeCache interface { // Add adds an id into the cache, if it is not already there. // Returns true if the id was newly added to the cache. // Depending on the implementation strategy, it may or may not update the expiry of // an existing entry. Add(string) bool // Has checks the cache for the presence of an id. // Depending on the implementation strategy, it may or may not update the expiry of // an existing entry. Has(string) bool // Done signals that the user is done with this cache, which it may stop background threads // and relinquish resources. Done() }
TimeCache is a cahe of recently seen messages (by id).
func NewTimeCache ¶
NewTimeCache defaults to the original ("first seen") cache implementation
Click to show internal directories.
Click to hide internal directories.