diskusage

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2024 License: AGPL-3.0 Imports: 1 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.

Jump to

Keyboard shortcuts

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