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 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
- func Version() string
- type Adaptor
- type AdaptorInterface
- type Connection
- type Device
- type Driver
- func (d *Driver) Adaptor() AdaptorInterface
- func (d *Driver) AddCommand(name string, f func(map[string]interface{}) interface{})
- func (d *Driver) AddEvent(name string)
- func (d *Driver) Command(name string) func(map[string]interface{}) interface{}
- func (d *Driver) Commands() map[string]func(map[string]interface{}) interface{}
- func (d *Driver) Event(name string) *Event
- func (d *Driver) Events() map[string]*Event
- func (d *Driver) Interval() time.Duration
- func (d *Driver) Name() string
- func (d *Driver) Pin() string
- func (d *Driver) SetInterval(t time.Duration)
- func (d *Driver) SetName(s string)
- func (d *Driver) SetPin(pin string)
- func (d *Driver) ToJSON() *JSONDevice
- func (d *Driver) Type() string
- type DriverInterface
- type Event
- type Gobot
- func (g *Gobot) AddCommand(name string, f func(map[string]interface{}) interface{})
- func (g *Gobot) AddRobot(r *Robot) *Robot
- func (g *Gobot) Command(name string) func(map[string]interface{}) interface{}
- func (g *Gobot) Commands() map[string]func(map[string]interface{}) interface{}
- func (g *Gobot) Robot(name string) *Robot
- func (g *Gobot) Robots() *robots
- func (g *Gobot) Start()
- func (g *Gobot) ToJSON() *JSONGobot
- 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) Command(name string) func(map[string]interface{}) interface{}
- func (r *Robot) Commands() map[string]func(map[string]interface{}) interface{}
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestAdaptor ¶
func NewTestAdaptor(name string) *testAdaptor
func NewTestDriver ¶
func NewTestDriver(name string, adaptor *testAdaptor) *testDriver
func NewTestStruct ¶
func NewTestStruct() *testStruct
Types ¶
type Adaptor ¶
type Adaptor struct {
// contains filtered or unexported fields
}
func NewAdaptor ¶
func (*Adaptor) SetConnected ¶
func (*Adaptor) ToJSON ¶
func (a *Adaptor) ToJSON() *JSONConnection
type AdaptorInterface ¶
type Connection ¶
type Connection AdaptorInterface
type Device ¶
type Device DriverInterface
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func (*Driver) Adaptor ¶
func (d *Driver) Adaptor() AdaptorInterface
func (*Driver) AddCommand ¶
func (*Driver) SetInterval ¶
func (*Driver) ToJSON ¶
func (d *Driver) ToJSON() *JSONDevice
type DriverInterface ¶
type DriverInterface interface { Start() bool Halt() bool Adaptor() AdaptorInterface SetInterval(time.Duration) Interval() time.Duration SetName(string) Name() string Pin() string SetPin(string) Command(string) func(map[string]interface{}) interface{} Commands() map[string]func(map[string]interface{}) interface{} AddCommand(string, func(map[string]interface{}) interface{}) Events() map[string]*Event Event(string) *Event AddEvent(string) Type() string ToJSON() *JSONDevice }
type Gobot ¶
type Gobot struct {
// 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 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 (r *Robot) Connection(name string) Connection
func (*Robot) Connections ¶
func (r *Robot) Connections() *connections
Source Files ¶
Click to show internal directories.
Click to hide internal directories.