resolver

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 18 Imported by: 60

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

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 struct {
	Name string
	Node cid.Cid
}

ErrNoLink is returned when a link is not found in a path

Deprecated: use github.com/ipfs/boxo/path/resolver.ErrNoLink

func (ErrNoLink) Error

func (e ErrNoLink) Error() string

Error implements the Error interface for ErrNoLink with a useful human readable message.

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

Jump to

Keyboard shortcuts

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