cache

package
v1.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2020 License: Apache-2.0, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapCache

type MapCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MapCache is a simple cache that stores data in memory.

func NewMapCache

func NewMapCache() *MapCache

NewMapCache creates a new in memory cache backed by a map.

func (*MapCache) Add

func (mc *MapCache) Add(round uint64, result client.Result)

Add adds an item to the cache

func (*MapCache) TryGet

func (mc *MapCache) TryGet(round uint64) client.Result

TryGet provides a round beacon or nil if it is not cached.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL