Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface {
Start() error
Stop() error
GetConf() DriverConf
Copy() Driver
String() string
}
type DriverConf ¶
type DriverConfEnvelope ¶
type DriverConfEnvelope struct {
Type string `json:"type"`
ID string `json:"id"`
AdaptorID string `json:"adaptor-id"`
Qualifier string `json:"qualifier"`
Subscriptions []string `json:"subscriptions"`
Conf interface{} `json:"conf"`
}
DriverConfEnvelope is used primarly for easy marshalling/unmarshalling of various DriverConf.
type DriversConfEnvelope ¶
type DriversConfEnvelope struct {
MachineID string `json:"machine-id"`
Confs []DriverConfEnvelope
}
DriversConfEnvelope is used primarly for easy marshalling/unmarshalling of 1 or more dirvers.
type Robot ¶
type Robot struct {
Name string
Work func()
AutoRun bool
// contains filtered or unexported fields
}
Robot is a named entity that manages a collection of devices. It contains its own work routine and a collection of custom commands to control a robot remotely via the Gobot api.
func NewRobot ¶
func NewRobot(v ...interface{}) *Robot
NewRobot returns a new Robot. It supports the following optional params:
name: string with the name of the Robot. A name will be automatically generated if no name is supplied. []Device: Devices which are automatically started and stopped with the robot func(): The work routine the robot will execute once all devices have been initialized and started
func (*Robot) AddDevice ¶
AddDevice adds a new Device to the robots collection of devices. Returns the added device.
func (*Robot) Device ¶
Device returns a device given a name. Returns nil if the Device does not exist.
Click to show internal directories.
Click to hide internal directories.