Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

feat: add UseCumulativeSize UnixfsLs option #95

Merged
merged 1 commit into from
Dec 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion options/unixfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ type UnixfsAddSettings struct {
}

type UnixfsLsSettings struct {
ResolveChildren bool
ResolveChildren bool
UseCumulativeSize bool
}

type UnixfsAddOption func(*UnixfsAddSettings) error
Expand Down Expand Up @@ -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
}
}