du.go 594 B

12345678910111213141516171819202122
  1. package fs
  2. import "context"
  3. // Usage of disk information
  4. type Usage struct {
  5. Inodes int64
  6. Size int64
  7. }
  8. // DiskUsage counts the number of inodes and disk usage for the resources under
  9. // path.
  10. func DiskUsage(ctx context.Context, roots ...string) (Usage, error) {
  11. return diskUsage(ctx, roots...)
  12. }
  13. // DiffUsage counts the numbers of inodes and disk usage in the
  14. // diff between the 2 directories. The first path is intended
  15. // as the base directory and the second as the changed directory.
  16. func DiffUsage(ctx context.Context, a, b string) (Usage, error) {
  17. return diffUsage(ctx, a, b)
  18. }