Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UnverifiedBlockStore ¶
type UnverifiedBlockStore struct {
// contains filtered or unexported fields
}
UnverifiedBlockStore holds an in memory cache of receied blocks from the network that have not been verified to be part of a traversal
func New ¶
func New(storer ipld.Storer) *UnverifiedBlockStore
New initializes a new unverified store with the given storer function for writing to permaneant storage if the block is verified
func (*UnverifiedBlockStore) AddUnverifiedBlock ¶
func (ubs *UnverifiedBlockStore) AddUnverifiedBlock(lnk ipld.Link, data []byte)
AddUnverifiedBlock adds a new unverified block to the in memory cache as it comes in as part of a traversal.
func (*UnverifiedBlockStore) PruneBlock ¶ added in v0.3.0
func (ubs *UnverifiedBlockStore) PruneBlock(link ipld.Link)
PruneBlock deletes an individual block from the store
func (*UnverifiedBlockStore) PruneBlocks ¶
func (ubs *UnverifiedBlockStore) PruneBlocks(shouldPrune func(ipld.Link) bool)
PruneBlocks removes blocks from the unverified store without committing them, if the passed in function returns true for the given link
func (*UnverifiedBlockStore) VerifyBlock ¶
func (ubs *UnverifiedBlockStore) VerifyBlock(lnk ipld.Link) ([]byte, error)
VerifyBlock verifies the data for the given link as being part of a traversal, removes it from the unverified store, and writes it to permaneant storage.