Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPeerTimeCache ¶ added in v1.0.127
func NewPeerTimeCache(timeCache storage.TimeCacheHandler) (*peerTimeCache, error)
NewPeerTimeCache creates a new peer time cache data structure instance
Types ¶
type TimeCache ¶
type TimeCache struct {
// contains filtered or unexported fields
}
TimeCache can retain an amount of string keys for a defined period of time sweeping (clean-up) is triggered each time a new item is added or a key is present in the time cache This data structure is concurrent safe.
func NewTimeCache ¶
NewTimeCache creates a new time cache data structure instance
func (*TimeCache) Add ¶
Add will store the key in the time cache Double adding the key is not permitted by the time cache. Also, add will trigger sweeping.
func (*TimeCache) AddWithSpan ¶ added in v1.0.120
AddWithSpan will store the key in the time cache with the provided span duration Double adding the key is not permitted by the time cache. Also, add will trigger sweeping.
func (*TimeCache) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface