freeze

package
v0.8.28 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: Apache-2.0, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Unfreeze

func Unfreeze(ctx context.Context, dirPaths []string, freezeAtPercent float64, dstore datastore.Datastore) error

Unfreeze explicitly triggers the indexer to exit frozen mode.

Types

type Freezer

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

Freezer monitors disk usage and triggers a freeze if the usage reaches a specified threshold.

func New

func New(dirPaths []string, freezeAtPercent float64, dstore datastore.Datastore, freezeFunc func() error) (*Freezer, error)

New creates a new Freezer that checks the usage of the file system at dirPath.

func (*Freezer) CheckNow

func (f *Freezer) CheckNow() bool

CheckNow triggers an immediate disk usage check.

func (*Freezer) Close

func (f *Freezer) Close()

Close stops the goroutine that checks disk usage.

func (*Freezer) Dirs added in v0.7.0

func (f *Freezer) Dirs() []string

Dirs returns the directories being monitored.

func (*Freezer) Freeze

func (f *Freezer) Freeze() error

Freeze manually triggers the indexer to enter frozen mode.

func (*Freezer) Frozen

func (f *Freezer) Frozen() bool

Frozen returns true if indexer is frozen.

func (*Freezer) Usage

func (f *Freezer) Usage() (*disk.UsageStats, error)

Usage returns the disk usage of the most used directory.

Jump to

Keyboard shortcuts

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