pruner

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotSkipped                   = ""
	SkipPlaceholder              = "filesystem is placeholder"
	SkipNoCorrespondenceOnSender = "filesystem has no correspondence on sender"
)

Variables

This section is empty.

Functions

func WithLogger

func WithLogger(ctx context.Context, log Logger) context.Context

Types

type FSReport

type FSReport struct {
	Filesystem                string
	SnapshotList, DestroyList []SnapshotReport
	SkipReason                FSSkipReason
	LastError                 string
}

type FSSkipReason

type FSSkipReason string

func (FSSkipReason) NotSkipped

func (r FSSkipReason) NotSkipped() bool

type History

type History interface {
	ReplicationCursor(ctx context.Context, req *pdu.ReplicationCursorReq) (*pdu.ReplicationCursorRes, error)
	ListFilesystems(ctx context.Context, req *pdu.ListFilesystemReq) (*pdu.ListFilesystemRes, error)
}

Try to keep it compatible with gitub.com/zrepl/zrepl/endpoint.Endpoint

type LocalPrunerFactory

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

func NewLocalPrunerFactory

func NewLocalPrunerFactory(in config.PruningLocal, promPruneSecs *prometheus.HistogramVec) (*LocalPrunerFactory, error)

func (*LocalPrunerFactory) BuildLocalPruner

func (f *LocalPrunerFactory) BuildLocalPruner(ctx context.Context, target Target, receiver History) *Pruner

type Logger

type Logger = logger.Logger

func GetLogger

func GetLogger(ctx context.Context) Logger

type Pruner

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

func (*Pruner) Prune

func (p *Pruner) Prune()

func (*Pruner) Report

func (p *Pruner) Report() *Report

func (*Pruner) State

func (p *Pruner) State() State

type PrunerFactory

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

func NewPrunerFactory

func NewPrunerFactory(in config.PruningSenderReceiver, promPruneSecs *prometheus.HistogramVec) (*PrunerFactory, error)

func (*PrunerFactory) BuildReceiverPruner

func (f *PrunerFactory) BuildReceiverPruner(ctx context.Context, target Target, receiver History) *Pruner

func (*PrunerFactory) BuildSenderPruner

func (f *PrunerFactory) BuildSenderPruner(ctx context.Context, target Target, receiver History) *Pruner

type Report

type Report struct {
	State              string
	Error              string
	Pending, Completed []FSReport
}

type SnapshotReport

type SnapshotReport struct {
	Name       string
	Replicated bool
	Date       time.Time
}

type State

type State int
const (
	Plan State = 1 << iota
	PlanErr
	Exec
	ExecErr
	Done
)

func StateString

func StateString(s string) (State, error)

StateString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func StateValues

func StateValues() []State

StateValues returns all values of the enum

func (State) IsAState

func (i State) IsAState() bool

IsAState returns "true" if the value is listed in the enum definition. "false" otherwise

func (State) String

func (i State) String() string

type Target

type Target interface {
	ListFilesystems(ctx context.Context, req *pdu.ListFilesystemReq) (*pdu.ListFilesystemRes, error)
	ListFilesystemVersions(ctx context.Context, req *pdu.ListFilesystemVersionsReq) (*pdu.ListFilesystemVersionsRes, error)
	DestroySnapshots(ctx context.Context, req *pdu.DestroySnapshotsReq) (*pdu.DestroySnapshotsRes, error)
}

Try to keep it compatible with gitub.com/zrepl/zrepl/endpoint.Endpoint

Jump to

Keyboard shortcuts

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