path

package
v0.0.0-...-241d124 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadPath = errors.New("invalid ipfs ref path")

ErrBadPath is returned when a given path is incorrectly formatted

View Source
var ErrNoComponents = errors.New(
	"path must contain at least one component")

Paths after a protocol must contain at least one component

Functions

This section is empty.

Types

type ErrNoLink struct {
	Name string
	Node mh.Multihash
}

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

type Path

type Path string

TODO: debate making this a private struct wrapped in a public interface would allow us to control creation, and cache segments.

func FromCid

func FromCid(c *cid.Cid) Path

FromCid safely converts a cid.Cid type to a Path type

func FromSegments

func FromSegments(prefix string, seg ...string) (Path, error)

func FromString

func FromString(s string) Path

FromString safely converts a string type to a Path type

func ParseCidToPath

func ParseCidToPath(txt string) (Path, error)

func ParsePath

func ParsePath(txt string) (Path, error)

func (*Path) IsValid

func (p *Path) IsValid() error

func (Path) Segments

func (p Path) Segments() []string

func (Path) String

func (p Path) String() string

Jump to

Keyboard shortcuts

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