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
c6015845
Commit
c6015845
authored
Dec 08, 2017
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: DAG API proposal
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
66117d4c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
interface.go
interface.go
+8
-1
No files found.
interface.go
View file @
c6015845
...
@@ -34,13 +34,14 @@ type Reader interface {
...
@@ -34,13 +34,14 @@ type Reader interface {
type
CoreAPI
interface
{
type
CoreAPI
interface
{
// Unixfs returns an implementation of Unixfs API
// Unixfs returns an implementation of Unixfs API
Unixfs
()
UnixfsAPI
Unixfs
()
UnixfsAPI
Dag
()
DagAPI
// ResolvePath resolves the path using Unixfs resolver
// ResolvePath resolves the path using Unixfs resolver
ResolvePath
(
context
.
Context
,
Path
)
(
Path
,
error
)
ResolvePath
(
context
.
Context
,
Path
)
(
Path
,
error
)
// ResolveNode resolves the path (if not resolved already) using Unixfs
// ResolveNode resolves the path (if not resolved already) using Unixfs
// resolver, gets and returns the resolved Node
// resolver, gets and returns the resolved Node
ResolveNode
(
context
.
Context
,
Path
)
(
Node
,
error
)
ResolveNode
(
context
.
Context
,
Path
)
(
Node
,
error
)
//TODO: should this get dropped in favor of DagAPI.Get?
}
}
// UnixfsAPI is the basic interface to immutable files in IPFS
// UnixfsAPI is the basic interface to immutable files in IPFS
...
@@ -55,6 +56,12 @@ type UnixfsAPI interface {
...
@@ -55,6 +56,12 @@ type UnixfsAPI interface {
Ls
(
context
.
Context
,
Path
)
([]
*
Link
,
error
)
Ls
(
context
.
Context
,
Path
)
([]
*
Link
,
error
)
}
}
type
DagAPI
interface
{
Put
(
ctx
context
.
Context
,
src
io
.
Reader
,
inputEnc
string
,
format
*
cid
.
Prefix
)
([]
Node
,
error
)
Get
(
ctx
context
.
Context
,
path
Path
)
(
Node
,
error
)
Tree
(
ctx
context
.
Context
,
path
Path
,
depth
int
)
([]
Path
,
error
)
}
// type ObjectAPI interface {
// type ObjectAPI interface {
// New() (cid.Cid, Object)
// New() (cid.Cid, Object)
// Get(string) (Object, error)
// Get(string) (Object, 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