Documentation
¶
Overview ¶
Package resolver implements utilities for resolving paths within ipfs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
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
Deprecated: use github.com/ipfs/boxo/path/resolver.ErrNoComponents
Functions ¶
func ResolveSingle
deprecated
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.
Deprecated: use github.com/ipfs/boxo/path/resolver.ResolveSingle
Types ¶
type ErrNoLink
deprecated
ErrNoLink is returned when a link is not found in a path
Deprecated: use github.com/ipfs/boxo/path/resolver.ErrNoLink
type Resolver
deprecated
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.
Deprecated: use github.com/ipfs/boxo/path/resolver.Resolver
func NewBasicResolver
deprecated
func NewBasicResolver(fetcherFactory fetcher.Factory) Resolver
NewBasicResolver constructs a new basic resolver.
Deprecated: use github.com/ipfs/boxo/path/resolver.NewBasicResolver