Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpochSpansCache ¶
type EpochSpansCache struct {
// contains filtered or unexported fields
}
EpochSpansCache is used to store the spans needed on a per-epoch basis for slashing detection.
func NewEpochSpansCache ¶
func NewEpochSpansCache(size int, onEvicted func(key interface{}, value interface{})) (*EpochSpansCache, error)
NewEpochSpansCache initializes the map and underlying cache.
func (*EpochSpansCache) Clear ¶
func (c *EpochSpansCache) Clear()
Clear removes all keys from the SpanCache.
func (*EpochSpansCache) Delete ¶
func (c *EpochSpansCache) Delete(epoch uint64) bool
Delete removes an epoch from the cache and returns if it existed or not. Performs the onEviction function before removal.
func (*EpochSpansCache) Get ¶
Get returns an ok bool and the cached value for the requested epoch key, if any.
func (*EpochSpansCache) Has ¶
func (c *EpochSpansCache) Has(epoch uint64) bool
Has returns true if the key exists in the cache.
Click to show internal directories.
Click to hide internal directories.