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
c593c49d
Commit
c593c49d
authored
Dec 11, 2017
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: add tests for dag
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
c6015845
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
interface.go
interface.go
+10
-2
No files found.
interface.go
View file @
c593c49d
...
...
@@ -41,7 +41,7 @@ type CoreAPI interface {
// ResolveNode resolves the path (if not resolved already) using Unixfs
// resolver, gets and returns the resolved Node
ResolveNode
(
context
.
Context
,
Path
)
(
Node
,
error
)
//TODO: should this get dropped in favor of DagAPI.Get?
ResolveNode
(
context
.
Context
,
Path
)
(
Node
,
error
)
}
// UnixfsAPI is the basic interface to immutable files in IPFS
...
...
@@ -56,9 +56,17 @@ type UnixfsAPI interface {
Ls
(
context
.
Context
,
Path
)
([]
*
Link
,
error
)
}
// DagAPI specifies the interface to IPLD
type
DagAPI
interface
{
Put
(
ctx
context
.
Context
,
src
io
.
Reader
,
inputEnc
string
,
format
*
cid
.
Prefix
)
([]
Node
,
error
)
// Put inserts data using specified format and input encoding.
// If format is not specified (nil), default dag-cbor/sha256 is used
Put
(
ctx
context
.
Context
,
src
io
.
Reader
,
inputEnc
string
,
format
*
cid
.
Prefix
)
([]
Node
,
error
)
//TODO: make format optional
// Get attempts to resolve and get the node specified by the path
Get
(
ctx
context
.
Context
,
path
Path
)
(
Node
,
error
)
// Tree returns list of paths within a node specified by the path.
// To get all paths in a tree, set depth to -1
Tree
(
ctx
context
.
Context
,
path
Path
,
depth
int
)
([]
Path
,
error
)
}
...
...
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