helpers

package
v0.10.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2023 License: Apache-2.0, MIT Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Block

func Block(ctx context.Context, f fetcher.Fetcher, link ipld.Link) (ipld.Node, error)

Block fetches a schemaless node graph corresponding to single block by link.

func BlockAll

func BlockAll(ctx context.Context, f fetcher.Fetcher, root ipld.Link, cb fetcher.FetchCallback) error

BlockAll traverses all nodes in the graph linked by root. The nodes will be untyped and send over the results channel.

func BlockMatching

func BlockMatching(ctx context.Context, f fetcher.Fetcher, root ipld.Link, match ipld.Node, cb fetcher.FetchCallback) error

BlockMatching traverses a schemaless node graph starting with the given link using the given selector and possibly crossing block boundaries. Each matched node is sent to the FetchResult channel.

func OnBlocks

func OnBlocks(bv BlockCallback) fetcher.FetchCallback

OnBlocks produces a fetch call back that only gets called when visiting blocks during a fetch

func OnUniqueBlocks

func OnUniqueBlocks(bv BlockCallback) fetcher.FetchCallback

OnUniqueBlocks is a callback that only gets called visiting each block once

Types

type BlockCallback

type BlockCallback func(BlockResult) error

BlockCallback is a callback for visiting blocks

type BlockResult

type BlockResult struct {
	Node ipld.Node
	Link ipld.Link
}

BlockResult specifies a node at the top of a block boundary

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL