operator

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type BackupModule added in v0.6.1

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

type BackupSchedule added in v0.6.1

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 added in v0.6.1

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

type Bootstrapper added in v0.6.1

type Bootstrapper interface {
	Bootstrap() error
}

type Command

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

func (*Command) MarshalLogObject added in v0.6.1

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 added in v0.6.1

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 added in v0.6.1

func (o *Operator) LaunchBackupSchedules()

func (*Operator) RegisterBackupModule added in v0.6.1

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

func (*Operator) RegisterBackupSchedule added in v0.6.1

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 added in v0.6.1

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