storage

package
v0.0.0-...-e56f5d9 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFSType

func GetFSType(fsType int64) string

Types

type FSInfo

type FSInfo struct {
	// contains filtered or unexported fields
}

func GetFSInfo

func GetFSInfo(path string) (*FSInfo, error)

func (*FSInfo) Free

func (f *FSInfo) Free() string

func (*FSInfo) FreeBytes

func (f *FSInfo) FreeBytes() uint64

func (*FSInfo) FreeInodes

func (f *FSInfo) FreeInodes() uint64

func (*FSInfo) Total

func (f *FSInfo) Total() string

func (*FSInfo) TotalBytes

func (f *FSInfo) TotalBytes() uint64

func (*FSInfo) TotalInodes

func (f *FSInfo) TotalInodes() uint64

func (*FSInfo) Type

func (f *FSInfo) Type() string

func (*FSInfo) Used

func (f *FSInfo) Used() string

func (*FSInfo) UsedBytes

func (f *FSInfo) UsedBytes() uint64

type FormatSize

type FormatSize struct {
	// contains filtered or unexported fields
}

FormatSize supports user friendly formatting, comparing, and also converting to kb, mb, gb etc.

func Format

func Format(size float64, unit string) (*FormatSize, error)

func FormatByte

func FormatByte(size float64) *FormatSize

func (*FormatSize) Add

func (f *FormatSize) Add(x *FormatSize) (float64, string)

func (*FormatSize) Compare

func (f *FormatSize) Compare(x *FormatSize) int

func (*FormatSize) Convert

func (f *FormatSize) Convert(unit string, precision uint, doTruncate bool) (float64, string, error)

func (*FormatSize) FriendlyConvert

func (f *FormatSize) FriendlyConvert(precision uint, doTruncate bool) (float64, string, error)

func (*FormatSize) Round

func (f *FormatSize) Round(precision uint) float64

func (*FormatSize) Show

func (f *FormatSize) Show() string

func (*FormatSize) Sub

func (f *FormatSize) Sub(x *FormatSize) (float64, string)

func (*FormatSize) Truncate

func (f *FormatSize) Truncate(precision uint) float64

func (*FormatSize) Unit

func (f *FormatSize) Unit() string

Jump to

Keyboard shortcuts

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