1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-19 09:52:03 +08:00

coreapi: separate path into two types

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
This commit is contained in:
Łukasz Magiera
2018-02-08 17:39:05 +01:00
parent 4f6c0666ea
commit 15f8fc60c0
18 changed files with 158 additions and 141 deletions

View File

@ -6,13 +6,24 @@ import (
// 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.
// TODO: figure out/explain namespaces
type Path interface {
// String returns the path as a string.
String() string
// Namespace returns the first component of the path
Namespace() string
}
// ResolvedPath is a resolved Path
type ResolvedPath interface {
// Cid returns cid referred to by path
Cid() *cid.Cid
// Root returns cid of root path
Root() *cid.Cid
// Resolved returns whether path has been fully resolved
Resolved() bool
//TODO: Path remainder
Path
}