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

coreapi ls: merge ResolveType and ResolveSize

License: MIT
Signed-off-by: default avatarŁukasz Magiera <magik6k@gmail.com>
parent a62acc82
...@@ -43,8 +43,7 @@ type UnixfsAddSettings struct { ...@@ -43,8 +43,7 @@ type UnixfsAddSettings struct {
} }
type UnixfsLsSettings struct { type UnixfsLsSettings struct {
ResolveType bool ResolveChildren bool
ResolveSize bool
} }
type UnixfsAddOption func(*UnixfsAddSettings) error type UnixfsAddOption func(*UnixfsAddSettings) error
...@@ -130,8 +129,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, ...@@ -130,8 +129,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
func UnixfsLsOptions(opts ...UnixfsLsOption) (*UnixfsLsSettings, error) { func UnixfsLsOptions(opts ...UnixfsLsOption) (*UnixfsLsSettings, error) {
options := &UnixfsLsSettings{ options := &UnixfsLsSettings{
ResolveSize: true, ResolveChildren: true,
ResolveType: true,
} }
for _, opt := range opts { for _, opt := range opts {
...@@ -313,16 +311,9 @@ func (unixfsOpts) Nocopy(enable bool) UnixfsAddOption { ...@@ -313,16 +311,9 @@ func (unixfsOpts) Nocopy(enable bool) UnixfsAddOption {
} }
} }
func (unixfsOpts) ResolveSize(resolve bool) UnixfsLsOption { func (unixfsOpts) ResolveChildren(resolve bool) UnixfsLsOption {
return func(settings *UnixfsLsSettings) error { return func(settings *UnixfsLsSettings) error {
settings.ResolveSize = resolve settings.ResolveChildren = resolve
return nil
}
}
func (unixfsOpts) ResolveType(resolve bool) UnixfsLsOption {
return func(settings *UnixfsLsSettings) error {
settings.ResolveType = resolve
return nil 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