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
1b5e997c
Commit
1b5e997c
authored
Dec 10, 2017
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: Name API proposal
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
20fa7a59
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
interface.go
interface.go
+19
-0
No files found.
interface.go
View file @
1b5e997c
...
...
@@ -6,6 +6,7 @@ import (
"context"
"errors"
"io"
"time"
options
"github.com/ipfs/go-ipfs/core/coreapi/interface/options"
...
...
@@ -27,6 +28,11 @@ type Path interface {
type
Node
ipld
.
Node
type
Link
ipld
.
Link
type
IpnsEntry
struct
{
Name
string
Value
Path
}
type
Reader
interface
{
io
.
ReadSeeker
io
.
Closer
...
...
@@ -37,6 +43,7 @@ type CoreAPI interface {
// Unixfs returns an implementation of Unixfs API
Unixfs
()
UnixfsAPI
Dag
()
DagAPI
Name
()
NameAPI
// ResolvePath resolves the path using Unixfs resolver
ResolvePath
(
context
.
Context
,
Path
)
(
Path
,
error
)
...
...
@@ -90,6 +97,18 @@ type DagAPI interface {
WithDepth
(
depth
int
)
options
.
DagTreeOption
}
type
NameAPI
interface
{
Publish
(
ctx
context
.
Context
,
path
Path
,
validTime
time
.
Duration
,
key
string
)
(
*
IpnsEntry
,
error
)
Resolve
(
ctx
context
.
Context
,
name
string
,
recursive
bool
,
local
bool
,
nocache
bool
)
(
Path
,
error
)
}
type
KeyApi
interface
{
Generate
(
ctx
context
.
Context
,
name
string
,
algorithm
string
,
size
int
)
error
List
(
ctx
context
.
Context
)
(
map
[
string
]
string
,
error
)
//TODO: better key type?
Rename
(
ctx
context
.
Context
,
oldName
string
,
newName
string
)
error
Remove
(
ctx
context
.
Context
,
name
string
)
error
}
// type ObjectAPI interface {
// New() (cid.Cid, Object)
// 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