coreapi unixfs: cid prefix options

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>


This commit was moved from ipfs/interface-go-ipfs-core@6c7f760b5d

This commit was moved from ipfs/boxo@0df36df660
This commit is contained in:
Łukasz Magiera 2018-09-20 15:59:53 +02:00
parent 7d9ebdcebe
commit d7afe85fe0
2 changed files with 7 additions and 2 deletions

View File

@ -8,7 +8,9 @@ type UnixfsAddSettings struct {
CidVersion int
MhType uint64
InlineLimit int
InlineLimit int
RawLeaves bool
RawLeavesSet bool
}
type UnixfsAddOption func(*UnixfsAddSettings) error
@ -18,7 +20,9 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, error) {
CidVersion: -1,
MhType: mh.SHA2_256,
InlineLimit: 0,
InlineLimit: 0,
RawLeaves: false,
RawLeavesSet: false,
}
for _, opt := range opts {

View File

@ -10,6 +10,7 @@ import (
)
// UnixfsAPI is the basic interface to immutable files in IPFS
// NOTE: This API is heavily WIP, things are guaranteed to break frequently
type UnixfsAPI interface {
// Add imports the data from the reader into merkledag file
Add(context.Context, io.ReadCloser, ...options.UnixfsAddOption) (ResolvedPath, error)