From b1299abda0c69529c7efa02d5efb9f8905fdd4fe 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) --- options/unixfs.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/options/unixfs.go b/options/unixfs.go index 3fd96f7..cd15991 100644 --- a/options/unixfs.go +++ b/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 + } +}