Documentation
¶
Index ¶
- Constants
- Variables
- func Register(name string, f NewTrackerFunc)
- type NewTrackerFunc
- type Registry
- func (r *Registry) AddDevice(d model.Device) error
- func (r *Registry) ExecuteDeviceAction(id string, action string) error
- func (r *Registry) FindDevice(id string) (model.Device, error)
- func (r *Registry) GetDevices(status model.Status) []model.Device
- func (r *Registry) RemoveDevice(id string) error
- func (r *Registry) Start(ctx context.Context)
- func (r *Registry) Stop()
- func (r *Registry) UpdateDevice(id string, ud model.Device) (model.Device, error)
- func (r *Registry) UpdateDevicesPresence(t time.Time)
- type ReportPresenceFunc
- type Tracker
Constants ¶
View Source
const ( ReportDataSuggestedIdentifier = "Identifier" ReportDataSuggestedDescription = "Description" )
Variables ¶
Functions ¶
func Register ¶
func Register(name string, f NewTrackerFunc)
Register records a Tracker factory function by name.
Types ¶
type NewTrackerFunc ¶
NewTrackerFunc is a factory function for instantiating a new Tracker.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maintains the status of all tracked devices together with their presence status.
func NewRegistry ¶
NewRegistry builds a new device registry.
func (*Registry) ExecuteDeviceAction ¶
ExecuteDeviceAction executes an action on a device given its identifier.
func (*Registry) FindDevice ¶
FindDevice lookups a device given its identifier.
func (*Registry) GetDevices ¶
GetDevices returns all known devices.
func (*Registry) RemoveDevice ¶
RemoveDevice removes a device.
func (*Registry) UpdateDevice ¶
UpdateDevice updates an existing device.
func (*Registry) UpdateDevicesPresence ¶
type ReportPresenceFunc ¶
ReportPresenceFunc is a function that can be used by a Tracker to report the presence of a given device interface. Optionally some data related to the inteface/device may be provided.
Click to show internal directories.
Click to hide internal directories.