restorewatcher

package
v0.0.0-...-8ff1004 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run a restorewatcher.

Types

type Config

type Config struct {
	RestoreInfoWatcher RestoreInfoWatcher
}

Config holds the worker configuration.

func (Config) Validate

func (config Config) Validate() error

Validate validates the worker configuration.

type ManifoldConfig

type ManifoldConfig struct {
	StateName string
	NewWorker func(Config) (RestoreStatusWorker, error)
}

ManifoldConfig holds the information necessary to run a restorewatcher in a dependency.Engine.

func (ManifoldConfig) Validate

func (config ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type RestoreInfoWatcher

type RestoreInfoWatcher interface {
	WatchRestoreInfoChanges() state.NotifyWatcher
	RestoreStatus() (state.RestoreStatus, error)
}

RestoreInfoWatcher is an interface for watching and obtaining the restore info/status.

type RestoreInfoWatcherShim

type RestoreInfoWatcherShim struct {
	*state.State
}

func (RestoreInfoWatcherShim) RestoreStatus

func (r RestoreInfoWatcherShim) RestoreStatus() (state.RestoreStatus, error)

type RestoreStatusWorker

type RestoreStatusWorker interface {
	worker.Worker

	// RestoreStatus returns the most recently observed restore status.
	RestoreStatus() state.RestoreStatus
}

RestoreStatusWorker is a worker that provides a means of observing the restore status.

func NewWorker

func NewWorker(config Config) (RestoreStatusWorker, error)

NewWorker returns a new worker that watches for changes to restore info, and reports the status to the provided function.

Jump to

Keyboard shortcuts

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