coreapi ls: merge ResolveType and ResolveSize
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com> This commit was moved from ipfs/interface-go-ipfs-core@d93b9f110ec9df2fb0e4f840974243ae878ffdf6 This commit was moved from ipfs/boxo@8d88635d4a9ae6462528d7a6cd7737ecbd5716de
Łukasz Magiera committed
Feb 2, 2019 at 17:13 UTC
39204505d087da8853f0800111b03348d5d896ed
1 file changed
+4
-13
core/coreiface/options/unixfs.go
+4
-13
@@ -43,8 +43,7 @@ type UnixfsAddSettings struct {
43
}
44
45
type UnixfsLsSettings struct {
46
- ResolveType bool
47
- ResolveSize bool
46
+ ResolveChildren bool
47
}
48
49
type UnixfsAddOption func(*UnixfsAddSettings) error
@@ -130,8 +129,7 @@ func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix,
129
130
func UnixfsLsOptions(opts ...UnixfsLsOption) (*UnixfsLsSettings, error) {
131
options := &UnixfsLsSettings{
133
- ResolveSize: true,
134
- ResolveType: true,
132
+ ResolveChildren: true,
133
}
134
135
for _, opt := range opts {
@@ -313,16 +311,9 @@ func (unixfsOpts) Nocopy(enable bool) UnixfsAddOption {
311
}
312
}
313
316
-func (unixfsOpts) ResolveSize(resolve bool) UnixfsLsOption {
314
+func (unixfsOpts) ResolveChildren(resolve bool) UnixfsLsOption {
315
return func(settings *UnixfsLsSettings) error {
318
- settings.ResolveSize = resolve
319
- return nil
320
- }
321
-}
322
-
323
-func (unixfsOpts) ResolveType(resolve bool) UnixfsLsOption {
324
- return func(settings *UnixfsLsSettings) error {
325
- settings.ResolveType = resolve
316
+ settings.ResolveChildren = resolve
317
return nil
318
}
319
}