Versions in this module Expand all Collapse all v1 v1.16.1 Oct 24, 2022 v1.16.0 Oct 18, 2022 Changes in this version + const AfterWorkKind + const EveryWorkKind + func After(t time.Duration, f func()) + func DefaultName(name string) string + func Every(t time.Duration, f func()) *time.Ticker + func FromScale(input, min, max float64) float64 + func Rand(max int) int + func Rescale(input, fromMin, fromMax, toMin, toMax float64) float64 + func ToScale(input, min, max float64) float64 + func Version() string + type Adaptor interface + Connect func() error + Finalize func() error + Name func() string + SetName func(n string) + type Commander interface + AddCommand func(name string, command func(map[string]interface{}) interface{}) + Command func(string) (command func(map[string]interface{}) interface{}) + Commands func() (commands map[string]func(map[string]interface{}) interface{}) + func NewCommander() Commander + type Connection Adaptor + type Connections []Connection + func (c *Connections) Each(f func(Connection)) + func (c *Connections) Finalize() (err error) + func (c *Connections) Len() int + func (c *Connections) Start() (err error) + type Device Driver + type Devices []Device + func (d *Devices) Each(f func(Device)) + func (d *Devices) Halt() (err error) + func (d *Devices) Len() int + func (d *Devices) Start() (err error) + type Driver interface + Connection func() Connection + Halt func() error + Name func() string + SetName func(s string) + Start func() error + type Event struct + Data interface{} + Name string + func NewEvent(name string, data interface{}) *Event + type Eventer interface + AddEvent func(name string) + DeleteEvent func(name string) + Event func(name string) string + Events func() (eventnames map[string]string) + On func(name string, f func(s interface{})) (err error) + Once func(name string, f func(s interface{})) (err error) + Publish func(name string, data interface{}) + Subscribe func() (events eventChannel) + Unsubscribe func(events eventChannel) + func NewEventer() Eventer + type JSONConnection struct + Adaptor string + Name string + func NewJSONConnection(connection Connection) *JSONConnection + type JSONDevice struct + Commands []string + Connection string + Driver string + Name string + func NewJSONDevice(device Device) *JSONDevice + type JSONMaster struct + Commands []string + Robots []*JSONRobot + func NewJSONMaster(gobot *Master) *JSONMaster + type JSONRobot struct + Commands []string + Connections []*JSONConnection + Devices []*JSONDevice + Name string + func NewJSONRobot(robot *Robot) *JSONRobot + type Master struct + AutoRun bool + func NewMaster() *Master + func (g *Master) AddRobot(r *Robot) *Robot + func (g *Master) Robot(name string) *Robot + func (g *Master) Robots() *Robots + func (g *Master) Running() bool + func (g *Master) Start() (err error) + func (g *Master) Stop() (err error) + type Pinner interface + Pin func() string + type Porter interface + Port func() string + type Robot struct + AutoRun bool + Name string + Work func() + WorkAfterWaitGroup *sync.WaitGroup + WorkEveryWaitGroup *sync.WaitGroup + func NewRobot(v ...interface{}) *Robot + func (r *Robot) AddConnection(c Connection) Connection + func (r *Robot) AddDevice(d Device) Device + func (r *Robot) After(ctx context.Context, d time.Duration, f func()) *RobotWork + 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) Every(ctx context.Context, d time.Duration, f func()) *RobotWork + func (r *Robot) Running() bool + func (r *Robot) Start(args ...interface{}) (err error) + func (r *Robot) Stop() error + func (r *Robot) WorkRegistry() *RobotWorkRegistry + type RobotWork struct + func (rw *RobotWork) CallCancelFunc() + func (rw *RobotWork) CancelFunc() context.CancelFunc + func (rw *RobotWork) Duration() time.Duration + func (rw *RobotWork) ID() uuid.UUID + func (rw *RobotWork) String() string + func (rw *RobotWork) TickCount() int + func (rw *RobotWork) Ticker() *time.Ticker + type RobotWorkRegistry struct + func (rwr *RobotWorkRegistry) Get(id uuid.UUID) *RobotWork + type Robots []*Robot + func (r *Robots) Each(f func(*Robot)) + func (r *Robots) Len() int + func (r *Robots) Start(args ...interface{}) (err error) + func (r *Robots) Stop() (err error)