(duc *diskUsageContext)
| 219 | } |
| 220 | |
| 221 | func (ctx *DiskUsageContext) verboseWriteTable(duc *diskUsageContext) error { |
| 222 | tmpl, err := ctx.startSubsection(defaultDiskUsageImageTableFormat) |
| 223 | if err != nil { |
| 224 | return err |
| 225 | } |
| 226 | _, _ = ctx.Output.Write([]byte("Images space usage:\n\n")) |
| 227 | for _, img := range duc.Images { |
| 228 | if err := ctx.contextFormat(tmpl, img); err != nil { |
| 229 | return err |
| 230 | } |
| 231 | } |
| 232 | ctx.postFormat(tmpl, newImageContext()) |
| 233 | |
| 234 | tmpl, err = ctx.startSubsection(defaultDiskUsageContainerTableFormat) |
| 235 | if err != nil { |
| 236 | return err |
| 237 | } |
| 238 | _, _ = ctx.Output.Write([]byte("\nContainers space usage:\n\n")) |
| 239 | for _, c := range duc.Containers { |
| 240 | if err := ctx.contextFormat(tmpl, c); err != nil { |
| 241 | return err |
| 242 | } |
| 243 | } |
| 244 | ctx.postFormat(tmpl, NewContainerContext()) |
| 245 | |
| 246 | tmpl, err = ctx.startSubsection(defaultDiskUsageVolumeTableFormat) |
| 247 | if err != nil { |
| 248 | return err |
| 249 | } |
| 250 | _, _ = ctx.Output.Write([]byte("\nLocal Volumes space usage:\n\n")) |
| 251 | for _, v := range duc.Volumes { |
| 252 | if err := ctx.contextFormat(tmpl, v); err != nil { |
| 253 | return err |
| 254 | } |
| 255 | } |
| 256 | ctx.postFormat(tmpl, newVolumeContext()) |
| 257 | |
| 258 | tmpl, err = ctx.startSubsection(defaultDiskUsageBuildCacheTableFormat) |
| 259 | if err != nil { |
| 260 | return err |
| 261 | } |
| 262 | _, _ = fmt.Fprintf(ctx.Output, "\nBuild cache usage: %s\n\n", units.HumanSize(float64(ctx.BuildCacheDiskUsage.TotalSize))) |
| 263 | for _, v := range duc.BuildCache { |
| 264 | if err := ctx.contextFormat(tmpl, v); err != nil { |
| 265 | return err |
| 266 | } |
| 267 | } |
| 268 | ctx.postFormat(tmpl, newBuildCacheContext()) |
| 269 | |
| 270 | return nil |
| 271 | } |
| 272 | |
| 273 | type diskUsageImagesContext struct { |
| 274 | HeaderContext |
no test coverage detected