@cryptotaxi247 / kubo / commits / 9e57389b0

coreapi unixfs: options for RawLeaves / Inline

License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> This commit was moved from ipfs/interface-go-ipfs-core@dbdf6fd63ad66e3b5e5649a349ee9ba9534590a0 This commit was moved from ipfs/boxo@6a3bc40fc4c131b19837c1007ba3e65a51de6ab1

Łukasz Magiera committed Sep 20, 2018 at 16:19 UTC 9e57389b045a5202e2c91037d9cfaa87df751729
1 file changed +15
core/coreiface/options/unixfs.go
+15
@@ -52,3 +52,18 @@ func (unixfsOpts) Hash(mhtype uint64) UnixfsAddOption {
52 return nil
53 }
54 }
55 +
56 +func (unixfsOpts) RawLeaves(enable bool) UnixfsAddOption {
57 + return func(settings *UnixfsAddSettings) error {
58 + settings.RawLeaves = enable
59 + settings.RawLeavesSet = true
60 + return nil
61 + }
62 +}
63 +
64 +func (unixfsOpts) InlineLimit(limit int) UnixfsAddOption {
65 + return func(settings *UnixfsAddSettings) error {
66 + settings.InlineLimit = limit
67 + return nil
68 + }
69 +}