Documentation ¶
Overview ¶
Package resolver implements utilities for resolving paths within ipfs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrNoLink ¶
ErrNoLink is returned when a link is not found in a path.
func (*ErrNoLink) Error ¶
Error implements the errors.Error interface.
type Resolver ¶
type Resolver interface { // ResolveToLastNode walks the given path and returns the CID of the last block // referenced by the path, as well as the remainder of the path segments to traverse // from the final block boundary to the final node within the block. ResolveToLastNode(context.Context, path.ImmutablePath) (cid.Cid, []string, error) // ResolvePath fetches the node for the given path. It returns the last item returned // by [Resolver.ResolvePathComponents] and the last link traversed which can be used // to recover the block. ResolvePath(context.Context, path.ImmutablePath) (ipld.Node, ipld.Link, error) // ResolvePathComponents fetches the nodes for each segment of the given path. It // uses the first path component as the CID of the first node, then resolves all // other components walking the links via a selector traversal. ResolvePathComponents(context.Context, path.ImmutablePath) ([]ipld.Node, error) }
Resolver provides path resolution to IPFS.
func NewBasicResolver ¶
NewBasicResolver constructs a new basic resolver using the given fetcher.Factory.
Click to show internal directories.
Click to hide internal directories.