Documentation ¶
Overview ¶
Package resolver implements utilities for resolving paths within ipfs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoComponents = errors.New(
"path must contain at least one component")
ErrNoComponents is used when Paths after a protocol do not contain at least one component
Functions ¶
func ResolveSingle ¶
func ResolveSingle(ctx context.Context, ds format.NodeGetter, nd format.Node, names []string) (*format.Link, []string, error)
ResolveSingle simply resolves one hop of a path through a graph with no extra context (does not opaquely resolve through sharded nodes) Deprecated: fetch node as ipld-prime or convert it and then use a selector to traverse through it.
Types ¶
type Resolver ¶
type Resolver interface { // ResolveToLastNode walks the given path and returns the cid of the // last block referenced by the path, and the path segments to // traverse from the final block boundary to the final node within the // block. ResolveToLastNode(ctx context.Context, fpath path.Path) (cid.Cid, []string, error) // ResolvePath fetches the node for given path. It returns the last // item returned by ResolvePathComponents and the last link traversed // which can be used to recover the block. ResolvePath(ctx context.Context, fpath path.Path) (ipld.Node, ipld.Link, error) // ResolvePathComponents fetches the nodes for each segment of the given path. // It uses the first path component as a hash (key) of the first node, then // resolves all other components walking the links via a selector traversal ResolvePathComponents(ctx context.Context, fpath path.Path) ([]ipld.Node, error) }
Resolver provides path resolution to IPFS.
func NewBasicResolver ¶
NewBasicResolver constructs a new basic resolver.
Click to show internal directories.
Click to hide internal directories.