Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
interface-go-dms3-core
Commits
5abaad9e
Commit
5abaad9e
authored
Apr 20, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: add more docs for path
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
a6d0272a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
path.go
path.go
+21
-3
No files found.
path.go
View file @
5abaad9e
...
...
@@ -17,7 +17,9 @@ type Path interface {
// String returns the path as a string.
String
()
string
// Namespace returns the first component of the path
// Namespace returns the first component of the path.
//
// For example path "/ipfs/QmHash", calling Namespace() will return "ipfs"
Namespace
()
string
// Mutable returns false if the data pointed to by this path in guaranteed
...
...
@@ -29,13 +31,29 @@ type Path interface {
// ResolvedPath is a resolved Path
type
ResolvedPath
interface
{
// Cid returns the CID referred to by path
// Cid returns the CID of the object referenced by the path.
//
// Example:
// If you have 3 linked objects: QmRoot -> A -> B, and resolve path
// "/ipfs/QmRoot/A/B", the Cid method will return the CID of object B
Cid
()
*
cid
.
Cid
// Root returns the CID of root path
// Root returns the CID of the root object of the path
//
// Example:
// If you have 3 linked objects: QmRoot -> A -> B, and resolve path
// "/ipfs/QmRoot/A/B", the Root method will return the CID of object QmRoot
Root
()
*
cid
.
Cid
// Remainder returns unresolved part of the path
//
// Example:
// If you have 2 linked objects: QmRoot -> A, where A is a CBOR node
// containing the following data:
//
// {"foo": {"bar": 42}}
//
// When resolving "/ipld/QmRoot/A/foo/bar", Remainder will return "foo/bar"
Remainder
()
string
Path
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment