machine

package
v0.0.0-...-a1a5cdc Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2019 License: Apache-2.0 Imports: 19 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OptionChanged

func OptionChanged(key string, value bool, data interface{})

Types

type AdaptorWrapper

type AdaptorWrapper struct {
	adaptorapi.Adaptor
}

AdaptorWrapper is a helper type used handle the adaptor type based serialization of its configuration.

func (*AdaptorWrapper) String

func (wrap *AdaptorWrapper) String() string

func (*AdaptorWrapper) UnmarshalJSON

func (wrap *AdaptorWrapper) UnmarshalJSON(data []byte) error

UnmarshalJSON creates the adaptor type specified in the JSON.

type ControllerWrapper

type ControllerWrapper struct {
	controllerapi.Controller
}

ControllerWrapper is a helper type used handle the controller type based serialization of its configuration.

func (*ControllerWrapper) String

func (wrap *ControllerWrapper) String() string

func (*ControllerWrapper) UnmarshalJSON

func (wrap *ControllerWrapper) UnmarshalJSON(data []byte) error

UnmarshalJSON creates the controller type specified in the JSON.

type DriverWrapper

type DriverWrapper struct {
	driverapi.Driver
}

DriverWrapper is a helper type used handle the driver type based serialization of its configuration.

func (*DriverWrapper) String

func (wrap *DriverWrapper) String() string

func (*DriverWrapper) UnmarshalJSON

func (wrap *DriverWrapper) UnmarshalJSON(data []byte) error

UnmarshalJSON creates the driver type specified in the JSON.

type Machine

type Machine struct {
	MachineID   string                 `json:"machine-id"`     // Machine ID.
	Adaptors    []*AdaptorWrapper      `json:"adaptors"`       // Machine adaptor for communicating with hardware.
	Drivers     []*DriverWrapper       `json:"drivers"`        // Drivers that are part of this machine.
	Controllers []*ControllerWrapper   `json:"controllers"`    // Controllers that are part of this machine.
	MsgRouter   *message.MessageRouter `json:"message-router"` // Route messages between drivers/controllers.
	Opts        *option.BoolOptions    `json:"options"`        // Machine options.
	Status      *MachineStatus         `json:"status,omitempty"`
	// contains filtered or unexported fields
}

Machine contains all the details for a particular machine.

func (*Machine) ApplyOpts

func (mh *Machine) ApplyOpts(opts option.OptionMap) bool

func (*Machine) AttachAdaptors

func (mh *Machine) AttachAdaptors(confs []adaptorapi.AdaptorConf) error

func (*Machine) DeepCopy

func (mh *Machine) DeepCopy(fromFile ...bool) *Machine

func (*Machine) DetachAdaptor

func (mh *Machine) DetachAdaptor(adaptorType, adaptorID string) error

func (*Machine) LogStatus

func (mh *Machine) LogStatus(code StatusCode, msg string)

func (*Machine) LogStatusOK

func (mh *Machine) LogStatusOK(msg string)

func (*Machine) LookupAdaptor

func (mh *Machine) LookupAdaptor(adaptorID string) adaptorapi.Adaptor

LookupAdaptor returns matching adaptorID IMPORTANT: if mutex lock is already held by calling func, use lookupAdaptor instead of this LookupHook

func (*Machine) LookupController

func (mh *Machine) LookupController(controllerType string) controllerapi.Controller

LookupController returns matching controllerType IMPORTANT: if mutex lock is already held by calling func, use lookupController instead of this LookupHook

func (*Machine) LookupDriver

func (mh *Machine) LookupDriver(driverType string) driverapi.Driver

LookupDriver returns matching driverType IMPORTANT: if mutex lock is already held by calling func, use lookupDriver instead of this LookupHook

func (*Machine) PrettyPrint

func (mh *Machine) PrettyPrint() string

func (*Machine) SetDefaultOpts

func (mh *Machine) SetDefaultOpts(opts *option.BoolOptions)

func (*Machine) Snapshot

func (mh *Machine) Snapshot() error

Snapshot will write the snapshot json in the mh's directory

func (*Machine) StartControllers

func (mh *Machine) StartControllers(confs []controllerapi.ControllerConf) error

func (*Machine) StartDrivers

func (mh *Machine) StartDrivers(confs []driverapi.DriverConf) error

func (*Machine) StopController

func (mh *Machine) StopController(controllerID string) error

func (*Machine) StopDriver

func (mh *Machine) StopDriver(driverType, driverID string) error

func (*Machine) Validate

func (mh *Machine) Validate() error

type MachineStatus

type MachineStatus struct {
	Log   []*statusLog `json:"log,omitempty"`
	Index int          `json:"index"`
	// contains filtered or unexported fields
}

func (*MachineStatus) DeepCopy

func (es *MachineStatus) DeepCopy() *MachineStatus

func (*MachineStatus) DumpLog

func (e *MachineStatus) DumpLog() string

func (*MachineStatus) String

func (e *MachineStatus) String() string

type Status

type Status struct {
	Code StatusCode `json:"code"`
	Msg  string     `json:"msg"`
}

func NewStatusOK

func NewStatusOK(info string) Status

func (Status) String

func (s Status) String() string

type StatusCode

type StatusCode int
const (
	OK       StatusCode = 0
	Warning  StatusCode = -1
	Failure  StatusCode = -2
	Disabled StatusCode = -3
	Info     StatusCode = -4
)

func (StatusCode) String

func (sc StatusCode) String() string

type StatusResponse

type StatusResponse struct {
	Logstash Status `json:"logstash"`
	Matra    Status `json:"matra"`
}

Jump to

Keyboard shortcuts

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