filesystem

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 11 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFilterWithList

func BuildFilterWithList(ignored []string) func(FSStat) bool

BuildFilterWithList returns a filesystem filter with the given list of FS types

func DefaultIgnoredTypes

func DefaultIgnoredTypes(sys resolve.Resolver) []string

DefaultIgnoredTypes tries to guess a sane list of filesystem types that could be ignored in the running system

Types

type FSStat

type FSStat struct {
	Directory string   `struct:"mount_point,omitempty"`
	Device    string   `struct:"device_name,omitempty"`
	Type      string   `struct:"type,omitempty"`
	Options   string   `struct:"options,omitempty"`
	Flags     opt.Uint `struct:"flags,omitempty"`
	// metrics
	Total     opt.Uint `struct:"total,omitempty"`
	Free      opt.Uint `struct:"free,omitempty"`
	Avail     opt.Uint `struct:"available,omitempty"`
	Used      UsedVals `struct:"used,omitempty"`
	Files     opt.Uint `struct:"files,omitempty"`
	FreeFiles opt.Uint `struct:"free_files,omitempty"`
}

FSStat carries the metadata for a given filesystem

func GetFilesystems

func GetFilesystems(hostfs resolve.Resolver, filter func(FSStat) bool) ([]FSStat, error)

GetFilesystems returns a filesystem list filtered by the callback function

func (*FSStat) GetUsage

func (fs *FSStat) GetUsage() error

GetUsage returns the filesystem usage

type UsedVals

type UsedVals struct {
	Pct   opt.Float `struct:"pct,omitempty"`
	Bytes opt.Uint  `struct:"bytes,omitempty"`
}

UsedVals wraps the `used` disk metrics

func (UsedVals) IsZero

func (u UsedVals) IsZero() bool

IsZero implements the IsZero interface for go-structform

Jump to

Keyboard shortcuts

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