runtime

package
v0.3.0-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2019 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configurator

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

Configurator defines the configuration 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)
}

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
)

Jump to

Keyboard shortcuts

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