Documentation
¶
Index ¶
- func DecodeNode(encoded []byte) (ipld.Node, error)
- func EncodeNode(node ipld.Node) ([]byte, error)
- func ParseSelector(selector ipld.Node) (selector.Selector, error)
- func Traverse(ctx context.Context, loader ipld.Loader, ...) error
- func WalkMatching(node ipld.Node, s selector.Selector, fn traversal.VisitFn) error
- type ContextCancelError
- type TraversalBuilder
- type Traverser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ContextCancelError ¶
type ContextCancelError struct{}
ContextCancelError is a sentinel that indicates the passed in context was cancelled
func (ContextCancelError) Error ¶
func (cp ContextCancelError) Error() string
type TraversalBuilder ¶
type TraversalBuilder struct { Root ipld.Link Selector ipld.Node Visitor traversal.AdvVisitFn Chooser traversal.LinkTargetNodePrototypeChooser }
TraversalBuilder defines parameters for an iterative traversal
type Traverser ¶
type Traverser interface { // IsComplete returns the completion state (boolean) and if so, the final error result from IPLD IsComplete() (bool, error) // Current request returns the current link waiting to be loaded CurrentRequest() (ipld.Link, ipld.LinkContext) // Advance advances the traversal successfully by supplying the given reader as the result of the next IPLD load Advance(reader io.Reader) error // Error errors the traversal by returning the given error as the result of the next IPLD load Error(err error) // Shutdown cancels the traversal Shutdown(ctx context.Context) }
Traverser is an interface for performing a selector traversal that operates iteratively -- it stops and waits for a manual load every time a block boundary is encountered
Click to show internal directories.
Click to hide internal directories.