util

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package util contains utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirSize

func DirSize(path string) (int64, int64, error)

DirSize returns directory total size (apparent size).

func PrintExecTime

func PrintExecTime(what string) func()

PrintExecTime measures execution time.

Types

type DiskUsage added in v0.0.11

type DiskUsage struct {
	Total     uint64  // total size of the file system
	Used      uint64  // total bytes used in file system
	Free      uint64  // total free bytes on file system
	Available uint64  // total available bytes on file system to an unprivileged user
	Percent   float64 // percentage of use on the file system
	Path      string
}

DiskUsage contains usage data.

func NewDiskUsage added in v0.0.11

func NewDiskUsage(path string) (*DiskUsage, error)

NewDiskUsage returns the DiskUsage instance of path or nil in case of error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL