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
aa7a8776
Commit
aa7a8776
authored
Oct 03, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi unixfs: stdin-name option
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
cb84af4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
options/unixfs.go
options/unixfs.go
+15
-4
No files found.
options/unixfs.go
View file @
aa7a8776
...
...
@@ -32,8 +32,9 @@ type UnixfsAddSettings struct {
OnlyHash
bool
Local
bool
Wrap
bool
Hidden
bool
Wrap
bool
Hidden
bool
StdinName
string
}
type
UnixfsAddOption
func
(
*
UnixfsAddSettings
)
error
...
...
@@ -55,8 +56,9 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
OnlyHash
:
false
,
Local
:
false
,
Wrap
:
false
,
Hidden
:
false
,
Wrap
:
false
,
Hidden
:
false
,
StdinName
:
""
,
}
for
_
,
opt
:=
range
opts
{
...
...
@@ -225,3 +227,12 @@ func (unixfsOpts) Hidden(hidden bool) UnixfsAddOption {
return
nil
}
}
// StdinName is the name set for files which don specify FilePath as
// os.Stdin.Name()
func
(
unixfsOpts
)
StdinName
(
name
string
)
UnixfsAddOption
{
return
func
(
settings
*
UnixfsAddSettings
)
error
{
settings
.
StdinName
=
name
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