prune

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnavailable = errors.New("lock unavailable")

Functions

This section is empty.

Types

type AcceptFunc

type AcceptFunc func(string, os.FileInfo) bool

func MakeAgeFilter

func MakeAgeFilter(deadline time.Time, opts uniquename.Options) AcceptFunc

MakeAgeFilter returns an acceptor function only permitting files older than deadline. Both the file's modification time and, if available, the time in the filename must be older.

type Pruner

type Pruner struct {
	Logger *zap.Logger
	Dir    string
	Accept AcceptFunc
	// contains filtered or unexported fields
}

Pruner removes files and directories accepted by the filter function.

func (Pruner) Run

func (p Pruner) Run(ctx context.Context) (resultErr error)

Jump to

Keyboard shortcuts

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