fsutils

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DiskSpeed           = SpeedLow
	DiskMaxWrites int32 = 32
	DiskSpeedMB   float64
)
View Source
var IsInExtremelyHighLoad = false
View Source
var IsInHighLoad = false

Functions

func CheckDiskIsFast added in v1.2.5

func CheckDiskIsFast() (speedMB float64, isFast bool, err error)

CheckDiskIsFast check disk is 'fast' disk to write

func CheckDiskWritingSpeed added in v1.2.5

func CheckDiskWritingSpeed() (speedMB float64, err error)

CheckDiskWritingSpeed test disk writing speed

func DiskIsExtremelyFast added in v1.2.7

func DiskIsExtremelyFast() bool

func DiskIsFast added in v1.2.7

func DiskIsFast() bool

func WriteBegin added in v1.2.7

func WriteBegin()

func WriteEnd added in v1.2.7

func WriteEnd()

func WriteReady added in v1.2.7

func WriteReady() bool

Types

type DiskSpeedCache added in v1.2.10

type DiskSpeedCache struct {
	Speed   Speed   `json:"speed"`
	SpeedMB float64 `json:"speedMB"`
}

type Locker added in v1.2.7

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

func NewLocker added in v1.2.7

func NewLocker(path string) *Locker

func (*Locker) Lock added in v1.2.7

func (this *Locker) Lock() error

func (*Locker) Release added in v1.2.7

func (this *Locker) Release() error

func (*Locker) TryLock added in v1.2.7

func (this *Locker) TryLock() (ok bool, err error)

type Speed added in v1.2.7

type Speed int
const (
	SpeedExtremelyFast Speed = 1
	SpeedFast          Speed = 2
	SpeedLow           Speed = 3
	SpeedExtremelySlow Speed = 4
)

func (Speed) String added in v1.2.7

func (this Speed) String() string

type StatResult

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

func NewStatResult

func NewStatResult(rawStat *unix.Statfs_t) *StatResult

func StatDevice added in v1.2.9

func StatDevice(path string) (*StatResult, error)

StatDevice device contains the path

func StatDeviceCache added in v1.2.9

func StatDeviceCache(path string) (*StatResult, error)

StatDeviceCache stat device with cache

func (*StatResult) FreeSize

func (this *StatResult) FreeSize() uint64

func (*StatResult) TotalSize

func (this *StatResult) TotalSize() uint64

func (*StatResult) UsedSize

func (this *StatResult) UsedSize() uint64

Jump to

Keyboard shortcuts

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