Commit cb84af4b authored by Łukasz Magiera's avatar Łukasz Magiera

coreapi unixfs: hidden opiton

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent b977abfc
......@@ -33,6 +33,7 @@ type UnixfsAddSettings struct {
Local bool
Wrap bool
Hidden bool
}
type UnixfsAddOption func(*UnixfsAddSettings) error
......@@ -55,6 +56,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
Local: false,
Wrap: false,
Hidden: false,
}
for _, opt := range opts {
......@@ -215,3 +217,11 @@ func (unixfsOpts) Wrap(wrap bool) UnixfsAddOption {
return nil
}
}
// Hidden enables adding of hidden files (files prefixed with '.')
func (unixfsOpts) Hidden(hidden bool) UnixfsAddOption {
return func(settings *UnixfsAddSettings) error {
settings.Hidden = hidden
return nil
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment