From 7339703fa9de8c3a5cdf0b0c010c12f176089a85 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 8 Dec 2022 15:52:17 +0100 Subject: [PATCH] feat: add UseCumulativeSize UnixfsLs option --- 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 + } +}