machine

package
v0.0.0-...-9d0dce2 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: Apache-2.0, Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CapGRPC           = "GRPC"
	CapDISABLE_ENGINE = "DISABLE_ENGINE"
)

Variables

This section is empty.

Functions

func HasMetadata

func HasMetadata(state *MachineState, metadata map[string]pkg.Set) bool

HasMetadata determine if the Metadata of a given MachineState matches the indicated values.

func IsLocalMachineID

func IsLocalMachineID(mID string) bool

IsLocalMachineID returns whether the given machine ID is equal to that of the local machine

Types

type Capabilities

type Capabilities map[string]bool

func (Capabilities) Has

func (c Capabilities) Has(capability string) bool

type CoreOSMachine

type CoreOSMachine struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCoreOSMachine

func NewCoreOSMachine(static MachineState, um unit.UnitManager) *CoreOSMachine

func (*CoreOSMachine) PeriodicRefresh

func (m *CoreOSMachine) PeriodicRefresh(interval time.Duration, stop <-chan struct{})

PeriodicRefresh updates the current state of the CoreOSMachine at the interval indicated. Operation ceases when the provided channel is closed.

func (*CoreOSMachine) Refresh

func (m *CoreOSMachine) Refresh()

Refresh updates the current state of the CoreOSMachine.

func (*CoreOSMachine) State

func (m *CoreOSMachine) State() (state MachineState)

State returns a MachineState object representing the CoreOSMachine's static state overlaid on its dynamic state at the time of execution.

func (*CoreOSMachine) String

func (m *CoreOSMachine) String() string

type FakeMachine

type FakeMachine struct {
	MachineState MachineState
}

func (*FakeMachine) State

func (fm *FakeMachine) State() MachineState

type Machine

type Machine interface {
	State() MachineState
}

type MachineState

type MachineState struct {
	ID           string
	PublicIP     string
	Metadata     map[string]string
	Capabilities Capabilities
	Version      string
}

MachineState represents a point-in-time snapshot of the state of the local host.

func (MachineState) MatchID

func (ms MachineState) MatchID(ID string) bool

func (MachineState) ShortID

func (ms MachineState) ShortID() string

Jump to

Keyboard shortcuts

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