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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user