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
52f5b7ce
Commit
52f5b7ce
authored
Dec 14, 2017
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: Basic object API implementation
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
2c3137f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
interface.go
interface.go
+23
-21
No files found.
interface.go
View file @
52f5b7ce
...
@@ -191,27 +191,29 @@ type KeyAPI interface {
...
@@ -191,27 +191,29 @@ type KeyAPI interface {
Remove
(
ctx
context
.
Context
,
name
string
)
(
Path
,
error
)
Remove
(
ctx
context
.
Context
,
name
string
)
(
Path
,
error
)
}
}
// type ObjectAPI interface {
//TODO: Should this use paths instead of cids?
// New() (cid.Cid, Object)
type
ObjectAPI
interface
{
// Get(string) (Object, error)
New
(
ctx
context
.
Context
)
(
Node
,
error
)
// Links(string) ([]*Link, error)
Put
(
context
.
Context
,
Node
)
error
// Data(string) (Reader, error)
Get
(
context
.
Context
,
Path
)
(
Node
,
error
)
// Stat(string) (ObjectStat, error)
Data
(
context
.
Context
,
Path
)
(
io
.
Reader
,
error
)
// Put(Object) (cid.Cid, error)
Links
(
context
.
Context
,
Path
)
([]
*
Link
,
error
)
// SetData(string, Reader) (cid.Cid, error)
Stat
(
context
.
Context
,
Path
)
(
*
ObjectStat
,
error
)
// AppendData(string, Data) (cid.Cid, error)
// AddLink(string, string, string) (cid.Cid, error)
AddLink
(
ctx
context
.
Context
,
base
Path
,
name
string
,
child
Path
,
create
bool
)
(
Node
,
error
)
//TODO: make create optional
// RmLink(string, string) (cid.Cid, error)
RmLink
(
context
.
Context
,
Path
,
string
)
(
Node
,
error
)
// }
AppendData
(
context
.
Context
,
Path
,
io
.
Reader
)
(
Node
,
error
)
SetData
(
context
.
Context
,
Path
,
io
.
Reader
)
(
Node
,
error
)
// type ObjectStat struct {
}
// Cid cid.Cid
// NumLinks int
type
ObjectStat
struct
{
// BlockSize int
Cid
*
cid
.
Cid
// LinksSize int
NumLinks
int
// DataSize int
BlockSize
int
// CumulativeSize int
LinksSize
int
// }
DataSize
int
CumulativeSize
int
}
var
ErrIsDir
=
errors
.
New
(
"object is a directory"
)
var
ErrIsDir
=
errors
.
New
(
"object is a directory"
)
var
ErrOffline
=
errors
.
New
(
"can't resolve, ipfs node is offline"
)
var
ErrOffline
=
errors
.
New
(
"can't resolve, ipfs node is offline"
)
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