diskusage

package
v0.45.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package diskusage is used to get platform specific file system usage information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiskUsage

type DiskUsage struct {
	// AvailableBytes is the total available bytes on file system to an unprivileged user.
	AvailableBytes uint64
	// SizeBytes is the total size of the file system in bytes.
	SizeBytes uint64
}

DiskUsage contains usage data and provides user-friendly access methods.

func Statfs added in v0.39.0

func Statfs(volumePath string) (DiskUsage, error)

Statfs returns file system statistics.

func (DiskUsage) AvailablePercent added in v0.39.0

func (du DiskUsage) AvailablePercent() float64

AvailablePercent returns the percentage (0.0-1.0) of the disk available to an unprivileged user see `man statfs` for how the underlying values are derived on your platform.

func (DiskUsage) String added in v0.44.0

func (du DiskUsage) String() string

Jump to

Keyboard shortcuts

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