Documentation ¶
Index ¶
- type LRUCache
- func (c *LRUCache) Add(blockHash *externalapi.DomainHash, isTrustedData bool, ...)
- func (c *LRUCache) Get(blockHash *externalapi.DomainHash, isTrustedData bool) (*externalapi.BlockGHOSTDAGData, bool)
- func (c *LRUCache) Has(blockHash *externalapi.DomainHash, isTrustedData bool) bool
- func (c *LRUCache) Remove(blockHash *externalapi.DomainHash, isTrustedData bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
LRUCache is a least-recently-used cache from lruKey to *externalapi.BlockGHOSTDAGData
func (*LRUCache) Add ¶
func (c *LRUCache) Add(blockHash *externalapi.DomainHash, isTrustedData bool, value *externalapi.BlockGHOSTDAGData)
Add adds an entry to the LRUCache
func (*LRUCache) Get ¶
func (c *LRUCache) Get(blockHash *externalapi.DomainHash, isTrustedData bool) (*externalapi.BlockGHOSTDAGData, bool)
Get returns the entry for the given key, or (nil, false) otherwise
func (*LRUCache) Has ¶
func (c *LRUCache) Has(blockHash *externalapi.DomainHash, isTrustedData bool) bool
Has returns whether the LRUCache contains the given key
func (*LRUCache) Remove ¶
func (c *LRUCache) Remove(blockHash *externalapi.DomainHash, isTrustedData bool)
Remove removes the entry for the the given key. Does nothing if the entry does not exist
Click to show internal directories.
Click to hide internal directories.