snapper

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron added in v0.6.0

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

func (*Cron) Report added in v0.6.0

func (s *Cron) Report() Report

func (*Cron) Run added in v0.6.0

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

type CronReport added in v0.6.0

type CronReport struct {
	State      CronState
	WakeupTime time.Time
	Errors     []string
	Progress   []*ReportFilesystem
}

type CronState added in v0.6.0

type CronState string
const (
	CronStateRunning CronState = "running"
	CronStateWaiting CronState = "waiting"
)

type Logger

type Logger = logger.Logger

type Periodic added in v0.6.0

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

func (*Periodic) Report added in v0.6.0

func (s *Periodic) Report() Report

func (*Periodic) Run added in v0.6.0

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

type PeriodicReport added in v0.6.0

type PeriodicReport 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 Report added in v0.2.0

type Report struct {
	Type     Type
	Periodic *PeriodicReport
	Cron     *CronReport
	Manual   *struct{}
}

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 interface {
	Run(ctx context.Context, snapshotsTaken chan<- struct{})
	Report() Report
}

type State

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

func (State) String

func (i State) String() string

type Type added in v0.6.0

type Type string
const (
	TypePeriodic Type = "periodic"
	TypeCron     Type = "cron"
	TypeManual   Type = "manual"
)

Jump to

Keyboard shortcuts

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