Documentation
¶
Index ¶
- type BlockReader
- type BlockVerifier
- type SelectorBlockReader
- type SelectorVerifier
- type Traverser
- func (t *Traverser) Advance(ctx context.Context, reader io.Reader) error
- func (t *Traverser) CurrentRequest(ctx context.Context) (ipld.Link, ipld.LinkContext)
- func (t *Traverser) Error(ctx context.Context, err error)
- func (t *Traverser) IsComplete(ctx context.Context) bool
- func (t *Traverser) Start(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockReader ¶
type BlockReader interface { // ReadBlock reads data from a single block. Data is nil // for intermediate nodes ReadBlock(context.Context) (retrievalmarket.Block, bool, error) }
BlockReader is any data struct that can be read block by block
func NewSelectorBlockReader ¶
func NewSelectorBlockReader(root ipld.Link, sel ipld.Node, loader ipld.Loader) BlockReader
NewSelectorBlockReader returns a new Block reader starting at the given root and using the given loader
type BlockVerifier ¶
BlockVerifier verifies blocks received are part of a dag, in the order the dag is expected to be traversed
func NewSelectorVerifier ¶
func NewSelectorVerifier(root ipld.Link, selector ipld.Node) BlockVerifier
NewSelectorVerifier returns a new selector based block verifier
type SelectorBlockReader ¶
type SelectorBlockReader struct {
// contains filtered or unexported fields
}
SelectorBlockReader reads an ipld data structure in individual blocks allowing the next block to be read and then advancing no further
func (*SelectorBlockReader) ReadBlock ¶
func (sr *SelectorBlockReader) ReadBlock(ctx context.Context) (retrievalmarket.Block, bool, error)
ReadBlock reads the next block in the IPLD traversal
type SelectorVerifier ¶
type SelectorVerifier struct {
// contains filtered or unexported fields
}
SelectorVerifier verifies a traversal of an IPLD data structure by feeding blocks in in the order they are traversed in a dag walk
type Traverser ¶
type Traverser struct {
// contains filtered or unexported fields
}
Traverser is a class to perform a selector traversal that stops every time a new block is loaded and waits for manual input (in the form of advance or error)
func NewTraverser ¶
func NewTraverser(root ipld.Link, selector ipld.Node) *Traverser
NewTraverser creates a new traverser
func (*Traverser) Advance ¶
Advance advances the traversal with an io.Reader for the next requested block
func (*Traverser) CurrentRequest ¶
CurrentRequest returns the current block load waiting to be fulfilled in order to advance further
func (*Traverser) IsComplete ¶
IsComplete returns true if a traversal is complete