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
b977abfc
Commit
b977abfc
authored
Oct 03, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi unixfs: wrap option
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
7b2fdc90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
options/unixfs.go
options/unixfs.go
+13
-0
No files found.
options/unixfs.go
View file @
b977abfc
...
@@ -31,6 +31,8 @@ type UnixfsAddSettings struct {
...
@@ -31,6 +31,8 @@ type UnixfsAddSettings struct {
Pin
bool
Pin
bool
OnlyHash
bool
OnlyHash
bool
Local
bool
Local
bool
Wrap
bool
}
}
type
UnixfsAddOption
func
(
*
UnixfsAddSettings
)
error
type
UnixfsAddOption
func
(
*
UnixfsAddSettings
)
error
...
@@ -51,6 +53,8 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
...
@@ -51,6 +53,8 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
Pin
:
false
,
Pin
:
false
,
OnlyHash
:
false
,
OnlyHash
:
false
,
Local
:
false
,
Local
:
false
,
Wrap
:
false
,
}
}
for
_
,
opt
:=
range
opts
{
for
_
,
opt
:=
range
opts
{
...
@@ -202,3 +206,12 @@ func (unixfsOpts) Local(local bool) UnixfsAddOption {
...
@@ -202,3 +206,12 @@ func (unixfsOpts) Local(local bool) UnixfsAddOption {
return
nil
return
nil
}
}
}
}
// Wrap tells the adder to wrap the added file structure with an additional
// directory.
func
(
unixfsOpts
)
Wrap
(
wrap
bool
)
UnixfsAddOption
{
return
func
(
settings
*
UnixfsAddSettings
)
error
{
settings
.
Wrap
=
wrap
return
nil
}
}
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