From ff2eb2bff265f34012cca335447987da546ecee2 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Mon, 12 Dec 2022 21:09:45 +0100 Subject: [PATCH] feat: add UseCumulativeSize UnixfsLs option (#95) This commit was moved from ipfs/interface-go-ipfs-core@b1299abda0c69529c7efa02d5efb9f8905fdd4fe --- coreiface/options/unixfs.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/coreiface/options/unixfs.go b/coreiface/options/unixfs.go index 3fd96f772..cd15991e2 100644 --- a/coreiface/options/unixfs.go +++ b/coreiface/options/unixfs.go @@ -39,7 +39,8 @@ type UnixfsAddSettings struct { } type UnixfsLsSettings struct { - ResolveChildren bool + ResolveChildren bool + UseCumulativeSize bool } type UnixfsAddOption func(*UnixfsAddSettings) error @@ -283,3 +284,10 @@ func (unixfsOpts) ResolveChildren(resolve bool) UnixfsLsOption { return nil } } + +func (unixfsOpts) UseCumulativeSize(use bool) UnixfsLsOption { + return func(settings *UnixfsLsSettings) error { + settings.UseCumulativeSize = use + return nil + } +}