path

package
v0.0.0-...-2963f48 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2015 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

package path 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 Resolver

type Resolver struct {
	DAG merkledag.DAGService
}

Resolver provides path resolution to IPFS It has a pointer to a DAGService, which is uses to resolve nodes.

func (s *Resolver) ResolveLinks(ndd *merkledag.Node, names []string) (
	nd *merkledag.Node, err error)

ResolveLinks iteratively resolves names by walking the link hierarchy. Every node is fetched from the DAGService, resolving the next name. Returns the last node found.

ResolveLinks(nd, []string{"foo", "bar", "baz"}) would retrieve "baz" in ("bar" in ("foo" in nd.Links).Links).Links

func (*Resolver) ResolvePath

func (s *Resolver) ResolvePath(fpath string) (*merkledag.Node, error)

ResolvePath fetches the node for given path. It uses the first path component as a hash (key) of the first node, then resolves all other components walking the links, with ResolveLinks.

Jump to

Keyboard shortcuts

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