Documentation
¶
Index ¶
- func After(t time.Duration, f func())
- func Every(t time.Duration, f func())
- func Expect(t *testing.T, a interface{}, b interface{})
- func FromScale(input, min, max float64) float64
- func NewConnection(adaptor AdaptorInterface, r *Robot) *connection
- func NewDevice(driver DriverInterface, r *Robot) *device
- func NewTestAdaptor(name string) *testAdaptor
- func NewTestDriver(name string, adaptor *testAdaptor) *testDriver
- func NewTestStruct() *testStruct
- func On(e *Event, f func(s interface{}))
- func Publish(e *Event, val interface{})
- func Rand(max int) int
- func ToScale(input, min, max float64) float64
- type Adaptor
- type AdaptorInterface
- type Connection
- type Device
- type Driver
- type DriverInterface
- type Event
- type Gobot
- type JSONConnection
- type JSONDevice
- type JSONGobot
- type JSONRobot
- type NullReadWriteCloser
- type Robot
- func (r *Robot) AddCommand(name string, f func(map[string]interface{}) interface{})
- func (r *Robot) AddConnection(c Connection) *connection
- func (r *Robot) AddDevice(d Device) *device
- func (r *Robot) Connection(name string) *connection
- func (r *Robot) Connections() connections
- func (r *Robot) Device(name string) *device
- func (r *Robot) Devices() devices
- func (r *Robot) Start()
- func (r *Robot) ToJSON() *JSONRobot
- type Robots
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
func NewConnection(adaptor AdaptorInterface, r *Robot) *connection
func NewDevice ¶
func NewDevice(driver DriverInterface, r *Robot) *device
func NewTestAdaptor ¶
func NewTestAdaptor(name string) *testAdaptor
func NewTestDriver ¶
func NewTestDriver(name string, adaptor *testAdaptor) *testDriver
func NewTestStruct ¶
func NewTestStruct() *testStruct
Types ¶
type AdaptorInterface ¶
type Connection ¶
type Driver ¶
type Driver struct { Adaptor AdaptorInterface Interval time.Duration Pin string Name string Commands map[string]func(map[string]interface{}) interface{} Events map[string]*Event }
func (*Driver) AddCommand ¶
type DriverInterface ¶
type Gobot ¶
type Gobot struct { Robots []*Robot Commands map[string]func(map[string]interface{}) interface{} // contains filtered or unexported fields }
func (*Gobot) AddCommand ¶
type JSONConnection ¶
type JSONDevice ¶
type JSONDevice struct { Name string `json:"name"` Driver string `json:"driver"` Connection *JSONConnection `json:"connection"` Commands []string `json:"commands"` }
type JSONRobot ¶
type JSONRobot struct { Name string `json:"name"` Commands []string `json:"commands"` Connections []*JSONConnection `json:"connections"` Devices []*JSONDevice `json:"devices"` }
type NullReadWriteCloser ¶
type NullReadWriteCloser struct{}
func (NullReadWriteCloser) Close ¶
func (NullReadWriteCloser) Close() error
type Robot ¶
type Robot struct { Name string Commands map[string]func(map[string]interface{}) interface{} Work func() // contains filtered or unexported fields }
func NewTestRobot ¶
func (*Robot) AddCommand ¶
func (*Robot) AddConnection ¶
func (r *Robot) AddConnection(c Connection) *connection
func (*Robot) Connection ¶
func (*Robot) Connections ¶
func (r *Robot) Connections() connections
Source Files
¶
Click to show internal directories.
Click to hide internal directories.