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
1ffde91c
Commit
1ffde91c
authored
Jan 06, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corapi: block docs
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
a7509ebf
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 @
1ffde91c
...
...
@@ -94,16 +94,35 @@ type UnixfsAPI interface {
Ls
(
context
.
Context
,
Path
)
([]
*
Link
,
error
)
}
// BlockAPI specifies the interface to the block layer
type
BlockAPI
interface
{
// Put imports raw block data, hashing it using specified settings.
Put
(
context
.
Context
,
io
.
Reader
,
...
options
.
BlockPutOption
)
(
Path
,
error
)
// WithFormat is an option for Put which specifies the multicodec to use to
// serialize the object. Default is "v0"
WithFormat
(
codec
string
)
options
.
BlockPutOption
// WithHash is an option for Put which specifies the multihash settings to use
// when hashing the object. Default is mh.SHA2_256 (0x12).
// If mhLen is set to -1, default length for the hash will be used
WithHash
(
mhType
uint64
,
mhLen
int
)
options
.
BlockPutOption
// Get attempts to resolve the path and return a reader for data in the block
Get
(
context
.
Context
,
Path
)
(
io
.
Reader
,
error
)
// Rm removes the block specified by the path from local blockstore.
// By default an error will be returned if the block can't be found locally.
//
// NOTE: If the specified block is pinned it won't be removed and no error
// will be returned
Rm
(
context
.
Context
,
Path
,
...
options
.
BlockRmOption
)
error
// WithForce is an option for Rm which, when set to true, will ignore
// non-existing blocks
WithForce
(
force
bool
)
options
.
BlockRmOption
// Stat returns information on
Stat
(
context
.
Context
,
Path
)
(
BlockStat
,
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