Documentation
¶
Index ¶
- func OptionChanged(key string, value bool, data interface{})
- type AdaptorWrapper
- type ControllerWrapper
- type DriverWrapper
- type Machine
- func (mh *Machine) ApplyOpts(opts option.OptionMap) bool
- func (mh *Machine) AttachAdaptors(confs []adaptorapi.AdaptorConf) error
- func (mh *Machine) DeepCopy(fromFile ...bool) *Machine
- func (mh *Machine) DetachAdaptor(adaptorType, adaptorID string) error
- func (mh *Machine) LogStatus(code StatusCode, msg string)
- func (mh *Machine) LogStatusOK(msg string)
- func (mh *Machine) LookupAdaptor(adaptorID string) adaptorapi.Adaptor
- func (mh *Machine) LookupController(controllerType string) controllerapi.Controller
- func (mh *Machine) LookupDriver(driverType string) driverapi.Driver
- func (mh *Machine) PrettyPrint() string
- func (mh *Machine) SetDefaultOpts(opts *option.BoolOptions)
- func (mh *Machine) Snapshot() error
- func (mh *Machine) StartControllers(confs []controllerapi.ControllerConf) error
- func (mh *Machine) StartDrivers(confs []driverapi.DriverConf) error
- func (mh *Machine) StopController(controllerID string) error
- func (mh *Machine) StopDriver(driverType, driverID string) error
- func (mh *Machine) Validate() error
- type MachineStatus
- type Status
- type StatusCode
- type StatusResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OptionChanged ¶
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 ¶
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) AttachAdaptors ¶
func (mh *Machine) AttachAdaptors(confs []adaptorapi.AdaptorConf) error
func (*Machine) DetachAdaptor ¶
func (*Machine) LogStatus ¶
func (mh *Machine) LogStatus(code StatusCode, msg string)
func (*Machine) LogStatusOK ¶
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 ¶
LookupDriver returns matching driverType IMPORTANT: if mutex lock is already held by calling func, use lookupDriver instead of this LookupHook
func (*Machine) PrettyPrint ¶
func (*Machine) SetDefaultOpts ¶
func (mh *Machine) SetDefaultOpts(opts *option.BoolOptions)
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 (*Machine) StopDriver ¶
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 ¶
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