path.go 634 Bytes
Newer Older
1 2 3
package iface

import (
Steven Allen's avatar
Steven Allen committed
4
	cid "gx/ipfs/QmYVNvtQkeZ6AKSwDrjQTs432QtL6umrrK41EBq3cu7iSP/go-cid"
5 6 7 8
)

// Path is a generic wrapper for paths used in the API. A path can be resolved
// to a CID using one of Resolve functions in the API.
9
// TODO: figure out/explain namespaces
10 11 12
type Path interface {
	// String returns the path as a string.
	String() string
13 14 15 16 17 18 19

	// Namespace returns the first component of the path
	Namespace() string
}

// ResolvedPath is a resolved Path
type ResolvedPath interface {
20 21
	// Cid returns cid referred to by path
	Cid() *cid.Cid
22

23 24
	// Root returns cid of root path
	Root() *cid.Cid
25 26 27 28

	//TODO: Path remainder

	Path
29
}