pruning

package
v0.7.10 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeepGrid

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

KeepGrid fits snapshots that match a given regex into a retentiongrid.Grid, uses the most recent snapshot among those that match the regex as 'now', and deletes all snapshots that do not fit the grid specification.

func MustNewKeepGrid added in v0.7.4

func MustNewKeepGrid(regex, gridspec string) *KeepGrid

func NewKeepGrid

func NewKeepGrid(in *config.PruneGrid) (p *KeepGrid, err error)

func (*KeepGrid) KeepRule

func (p *KeepGrid) KeepRule(snaps []Snapshot) (destroyList []Snapshot)

Prune filters snapshots with the retention grid.

type KeepLastN

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

func MustKeepLastN added in v0.7.4

func MustKeepLastN(n int, regex string) *KeepLastN

func NewKeepLastN

func NewKeepLastN(n int, regex string) (*KeepLastN, error)

func (KeepLastN) KeepRule

func (k KeepLastN) KeepRule(snaps []Snapshot) (destroyList []Snapshot)

type KeepNotReplicated

type KeepNotReplicated struct{}

func NewKeepNotReplicated

func NewKeepNotReplicated() *KeepNotReplicated

func (*KeepNotReplicated) KeepRule

func (*KeepNotReplicated) KeepRule(snaps []Snapshot) (destroyList []Snapshot)

type KeepRegex

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

func MustKeepRegex

func MustKeepRegex(expr string, negate bool) *KeepRegex

func NewKeepRegex

func NewKeepRegex(expr string, negate bool) (*KeepRegex, error)

func (*KeepRegex) KeepRule

func (k *KeepRegex) KeepRule(snaps []Snapshot) []Snapshot

type KeepRule

type KeepRule interface {
	KeepRule(snaps []Snapshot) (destroyList []Snapshot)
}

func RuleFromConfig

func RuleFromConfig(in config.PruningEnum) (KeepRule, error)

func RulesFromConfig

func RulesFromConfig(in []config.PruningEnum) (rules []KeepRule, err error)

type Snapshot

type Snapshot interface {
	Name() string
	Replicated() bool
	Date() time.Time
}

func PruneSnapshots

func PruneSnapshots(snaps []Snapshot, keepRules []KeepRule) []Snapshot

The returned snapshot list is guaranteed to only contains elements of input parameter snaps

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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