Commit 16bf087f authored by Łukasz Magiera's avatar Łukasz Magiera

coreapi: path review

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent e0565d2f
......@@ -34,6 +34,9 @@ func (e ErrNoLink) Error() string {
return fmt.Sprintf("no link named %q under %s", e.Name, e.Node.String())
}
// ResolveOnce resolves path through a single node
type ResolveOnce func(ctx context.Context, ds ipld.NodeGetter, nd ipld.Node, names []string) (*ipld.Link, []string, error)
// Resolver provides path resolution to IPFS
// It has a pointer to a DAGService, which is uses to resolve nodes.
// TODO: now that this is more modular, try to unify this code with the
......@@ -41,7 +44,7 @@ func (e ErrNoLink) Error() string {
type Resolver struct {
DAG ipld.NodeGetter
ResolveOnce func(ctx context.Context, ds ipld.NodeGetter, nd ipld.Node, names []string) (*ipld.Link, []string, error)
ResolveOnce ResolveOnce
}
// NewBasicResolver constructs a new basic resolver.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment