runtime

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrReboot = errors.New("reboot")

ErrReboot is raised to initiate early reboot sequence via panic.

Functions

This section is empty.

Types

type Configurator

type Configurator interface {
	Version() string
	Debug() bool
	Persist() bool
	Machine() machine.Machine
	Cluster() cluster.Cluster
	Validate(Mode) error
	String() (string, error)
	Bytes() ([]byte, error)
}

Configurator defines the configuration interface.

type ConfiguratorBundle added in v0.4.0

type ConfiguratorBundle interface {
	Init() Configurator
	ControlPlane() Configurator
	Join() Configurator
	TalosConfig() *config.Config
}

ConfiguratorBundle defines the configuration bundle interface.

type DefaultRuntime

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

DefaultRuntime implements the Runtime interface.

func (*DefaultRuntime) Config

func (d *DefaultRuntime) Config() Configurator

Config implements the Runtime interface.

func (*DefaultRuntime) Platform

func (d *DefaultRuntime) Platform() Platform

Platform implements the Runtime interface.

func (*DefaultRuntime) Sequence

func (d *DefaultRuntime) Sequence() Sequence

Sequence implements the Runtime interface.

type Mode

type Mode int

Mode is a runtime mode.

const (
	// Cloud represents a runtime mode.
	Cloud Mode = iota
	// Container represents a runtime mode.
	Container
	// Interactive represents a runtime mode.
	Interactive
	// Metal represents a runtime mode.
	Metal
)

func ModeFromString

func ModeFromString(s string) (m Mode, err error)

ModeFromString returns a runtime mode that matches the given string.

func (Mode) String

func (m Mode) String() string

String returns the string representation of a Mode.

type Platform

type Platform interface {
	Name() string
	Configuration() ([]byte, error)
	Hostname() ([]byte, error)
	Mode() Mode
	ExternalIPs() ([]net.IP, error)
	KernelArgs() procfs.Parameters
}

Platform is an interface describing a platform.

type Runtime

type Runtime interface {
	Platform() Platform
	Config() Configurator
	Sequence() Sequence
}

Runtime defines the runtime parameters.

func NewRuntime

func NewRuntime(p Platform, c Configurator, s Sequence) Runtime

NewRuntime initializes and returns the runtime interface.

type Sequence

type Sequence int

Sequence represents the sequence type.

const (
	// None is the none sequence.
	None Sequence = iota
	// Boot is the boot sequence.
	Boot
	// Shutdown is the shutdown sequence.
	Shutdown
	// Upgrade is the upgrade sequence.
	Upgrade
	// Reset is the reset sequence.
	Reset
)

Jump to

Keyboard shortcuts

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