snapper

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger = logger.Logger

type PeriodicOrManual

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

FIXME: properly abstract snapshotting:

  • split up things that trigger snapshotting from the mechanism
  • timer-based trigger (periodic)
  • call from control socket (manual)
  • mixed modes?
  • support a `zrepl snapshot JOBNAME` subcommand for config.SnapshottingManual

func (*PeriodicOrManual) Report added in v0.2.0

func (s *PeriodicOrManual) Report() *Report

Returns nil if manual

func (*PeriodicOrManual) Run

func (s *PeriodicOrManual) Run(ctx context.Context, wakeUpCommon chan<- struct{})

type Report added in v0.2.0

type Report struct {
	State State
	// valid in state SyncUp and Waiting
	SleepUntil time.Time
	// valid in state Err
	Error string
	// valid in state Snapshotting
	Progress []*ReportFilesystem
}

type ReportFilesystem added in v0.2.0

type ReportFilesystem struct {
	Path  string
	State SnapState

	// Valid in SnapStarted and later
	SnapName      string
	StartAt       time.Time
	Hooks         string
	HooksHadError bool

	// Valid in SnapDone | SnapError
	DoneAt time.Time
}

type SnapState

type SnapState uint
const (
	SnapPending SnapState = 1 << iota
	SnapStarted
	SnapDone
	SnapError
)

func (SnapState) String

func (i SnapState) String() string

type Snapper

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

func PeriodicFromConfig

func PeriodicFromConfig(g *config.Global, fsf zfs.DatasetFilter, in *config.SnapshottingPeriodic) (*Snapper, error)

func (*Snapper) Report added in v0.2.0

func (s *Snapper) Report() *Report

func (*Snapper) Run

func (s *Snapper) Run(ctx context.Context, snapshotsTaken chan<- struct{})

type State

type State uint
const (
	SyncUp State = 1 << iota
	SyncUpErrWait
	Planning
	Snapshotting
	Waiting
	ErrorWait
	Stopped
)

func (State) String

func (i State) String() string

Jump to

Keyboard shortcuts

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