Documentation ¶
Index ¶
- type Cache
- func (cache *Cache) Backend() Reader
- func (cache *Cache) Flush(output Writer, backend Reader) error
- func (cache *Cache) GetProposal(proposalHash []byte) (*payload.Ballot, error)
- func (cache *Cache) RemoveProposal(proposalHash []byte) error
- func (cache *Cache) Reset(backend Reader)
- func (cache *Cache) Sync(state Writer) error
- func (cache *Cache) UpdateProposal(proposalHash []byte, ballot *payload.Ballot) error
- type Iterable
- type IterableReader
- type IterableReaderWriter
- type ProposalHash
- type ProposalHashArray
- type Reader
- type ReaderWriter
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
The Cache helps prevent unnecessary IAVLTree updates and garbage generation.
func NewCache ¶
Returns a Cache that wraps an underlying NameRegCacheGetter to use on a cache miss, can write to an output Writer via Sync. Not goroutine safe, use syncStateCache if you need concurrent access
func (*Cache) GetProposal ¶
func (*Cache) RemoveProposal ¶
func (*Cache) Reset ¶
Resets the cache to empty initialising the backing map to the same size as the previous iteration.
type IterableReader ¶
type IterableReaderWriter ¶
type IterableReaderWriter interface { Iterable ReaderWriter }
type ProposalHash ¶
type ProposalHashArray ¶
type ProposalHashArray []ProposalHash
func (ProposalHashArray) Len ¶
func (p ProposalHashArray) Len() int
func (ProposalHashArray) Less ¶
func (p ProposalHashArray) Less(i, j int) bool
func (ProposalHashArray) Swap ¶
func (p ProposalHashArray) Swap(i, j int)
type ReaderWriter ¶
Click to show internal directories.
Click to hide internal directories.