disk

package
v0.0.0-...-7f8e41e Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2023 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NCDU_EXPORT_DATA_PATH = "/data"
	NCDU_JOB_LOCK_PREFIX  = "/tmp/sa-disk-ncdu-lock-"
	DATA_STALE_THRESHOLD  = time.Hour
)

Variables

View Source
var (
	RE_TIMESTRING = regexp.MustCompile(`\d{14}`)
)

Functions

func Clean

func Clean(dataPath string, dryRun bool, logger *logrus.Logger) error

func SelectNcduDataPath

func SelectNcduDataPath() string

func TopHugeDirsFromNcdu

func TopHugeDirsFromNcdu(topN uint64, raw []byte, parentPath string, maxDepth, depth uint64) (map[string]uint64, uint64, error)

Types

type DiskUsageChecker

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

func NewDiskUsageChecker

func NewDiskUsageChecker(config *UsageConfig, logger *logrus.Logger) (*DiskUsageChecker, error)

func (*DiskUsageChecker) Check

func (c *DiskUsageChecker) Check() error

func (*DiskUsageChecker) FindLatestExportedData

func (c *DiskUsageChecker) FindLatestExportedData() error

func (*DiskUsageChecker) HasDataFile

func (c *DiskUsageChecker) HasDataFile() bool

func (*DiskUsageChecker) IsForceRead

func (c *DiskUsageChecker) IsForceRead() bool

func (*DiskUsageChecker) ReadData

func (c *DiskUsageChecker) ReadData() error

type NcduNode

type NcduNode struct {
	Name  string
	Asize uint64
	Dsize uint64
	Ino   uint64
}

type UsageConfig

type UsageConfig struct {
	NcduDataPath string
	DataFile     string
	TopN         uint64
	MaxDepth     uint64
	CheckPath    string
	ForceCheck   bool
	ForceRead    bool
	Block        bool
}

Jump to

Keyboard shortcuts

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