operator

package
v0.0.2-0...-26b375a Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCleanExit = errors.New("clean exit")

Functions

This section is empty.

Types

type BackupModule

type BackupModule interface {
	RequiresStop() bool
	Backup(lastSeenBlockNum uint32) (string, error)
}

type BackupSchedule

type BackupSchedule struct {
	BlocksBetweenRuns     int
	TimeBetweenRuns       time.Duration
	RequiredHostnameMatch string // will not run backup if !empty env.Hostname != HostnameMatch
	BackuperName          string // must match id of backupModule
}

func NewBackupSchedule

func NewBackupSchedule(freqBlocks, freqTime, requiredHostname, backuperName string) (*BackupSchedule, error)

type Bootstrapper

type Bootstrapper interface {
	Bootstrap() error
}

type Command

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

func (*Command) MarshalLogObject

func (c *Command) MarshalLogObject(encoder zapcore.ObjectEncoder) error

func (*Command) Return

func (c *Command) Return(err error)

type HTTPOption

type HTTPOption func(r *mux.Router)

type ListableBackupModule

type ListableBackupModule interface {
	BackupModule
	List(params map[string]string) ([]string, error)
}

type Operator

type Operator struct {
	*shutter.Shutter

	Superviser nodeManager.ChainSuperviser
	// contains filtered or unexported fields
}

func New

func New(zlogger *zap.Logger, chainSuperviser nodeManager.ChainSuperviser, chainReadiness nodeManager.Readiness, options *Options) (*Operator, error)

func (*Operator) Launch

func (o *Operator) Launch(httpListenAddr string, options ...HTTPOption) error

func (*Operator) LaunchBackupSchedules

func (o *Operator) LaunchBackupSchedules()

func (*Operator) RegisterBackupModule

func (o *Operator) RegisterBackupModule(name string, mod BackupModule) error

func (*Operator) RegisterBackupSchedule

func (o *Operator) RegisterBackupSchedule(sched *BackupSchedule)

func (*Operator) RunEveryPeriod

func (o *Operator) RunEveryPeriod(period time.Duration, commandName string, params map[string]string)

func (*Operator) RunEveryXBlock

func (o *Operator) RunEveryXBlock(freq uint32, commandName string, params map[string]string)

func (*Operator) RunHTTPServer

func (o *Operator) RunHTTPServer(httpListenAddr string, options ...HTTPOption) *http.Server

type Options

type Options struct {
	Bootstrapper Bootstrapper

	EnableSupervisorMonitoring bool

	// Delay before sending Stop() to superviser, during which we return NotReady
	ShutdownDelay time.Duration
}

type RestorableBackupModule

type RestorableBackupModule interface {
	BackupModule
	Restore(name string) error
}

Jump to

Keyboard shortcuts

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