MCPcopy Create free account
hub / github.com/dropbox/dbxcli / renderUsage

Function renderUsage

cmd/du.go:59–75  ·  view source on GitHub ↗
(out io.Writer, usage *users.SpaceUsage)

Source from the content-addressed store, hash-verified

57}
58
59func renderUsage(out io.Writer, usage *users.SpaceUsage) error {
60 fmt.Fprintf(out, "Used: %s\n", humanize.IBytes(usage.Used))
61 fmt.Fprintf(out, "Type: %s\n", usage.Allocation.Tag)
62
63 allocation := usage.Allocation
64
65 switch allocation.Tag {
66 case "individual":
67 fmt.Fprintf(out, "Allocated: %s\n", humanize.IBytes(allocation.Individual.Allocated))
68 case "team":
69 fmt.Fprintf(out, "Allocated: %s (Used: %s)\n",
70 humanize.IBytes(allocation.Team.Allocated),
71 humanize.IBytes(allocation.Team.Used))
72 }
73
74 return nil
75}
76
77func newDuOutput(usage *users.SpaceUsage) duOutput {
78 return duOutput{

Callers 1

duFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected