| 57 | } |
| 58 | |
| 59 | func 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 | |
| 77 | func newDuOutput(usage *users.SpaceUsage) duOutput { |
| 78 | return duOutput{ |