Documentation ¶
Index ¶
- type DirectPinDriver
- type Driver
- type LedDriver
- type Machine
- type MachineFactory
- func (m *MachineFactory) AddDeviceFromConfig(name string, config map[string]string)
- func (m *MachineFactory) AddDevicesFromConfig(devices map[string]interface{})
- func (m *MachineFactory) Close() error
- func (m *MachineFactory) DefaultAction(identifier string)
- func (m *MachineFactory) Reset()
- func (m *MachineFactory) Start() []error
- func (m *MachineFactory) Stop() []error
- func (m *MachineFactory) Work(work func())
- type RgbLedDriver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectPinDriver ¶
type DirectPinDriver struct {
*gpio.DirectPinDriver
}
func (*DirectPinDriver) Flash ¶
func (d *DirectPinDriver) Flash() (err error)
Flash set's the LED's pins to their various states
type Driver ¶
type Driver interface { // Turn on On() (err error) // Turn off Off() (err error) // Flash Flash() (err error) }
Interface Driver which exposes common actions. Extend desired drivers to implement methods exposed in Driver.
type Machine ¶
type Machine interface { // Start machine Start() []error // Stop machine Stop() []error // Reset everything Reset() // Add work Work(func()) // Execute default action DefaultAction(identifier string) }
Machine interface
type MachineFactory ¶
MachineFactory struct, implements Machine
func NewMachineFromConfig ¶
func NewMachineFromConfig(config map[string]interface{}) *MachineFactory
NewMachineFromConfig will return an instance of Machine from the usual configurations. For more control, safety, drivers and so on, please create your own implementation.
func (*MachineFactory) AddDeviceFromConfig ¶
func (m *MachineFactory) AddDeviceFromConfig(name string, config map[string]string)
Add device from configuration
func (*MachineFactory) AddDevicesFromConfig ¶
func (m *MachineFactory) AddDevicesFromConfig(devices map[string]interface{})
Add devices from configuration
func (*MachineFactory) Close ¶
func (m *MachineFactory) Close() error
func (*MachineFactory) DefaultAction ¶
func (m *MachineFactory) DefaultAction(identifier string)
Execute default action. This will turn a matching device On then Off.
type RgbLedDriver ¶
type RgbLedDriver struct {
*gpio.RgbLedDriver
}
func (*RgbLedDriver) Flash ¶
func (l *RgbLedDriver) Flash() (err error)
Flash set's the LED's pins to their various states
Click to show internal directories.
Click to hide internal directories.