Documentation ¶
Overview ¶
Package events is a general definition of an event type to be passed through channels.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceResponse ¶
DeviceResponse a response event
func NewDeviceConnectedEvent ¶
func NewDeviceConnectedEvent(eventType EventType, subject string) DeviceResponse
NewDeviceConnectedEvent creates a new response event object
func NewErrorEventNoChangeID ¶
func NewErrorEventNoChangeID(eventType EventType, subject string, err error) DeviceResponse
NewErrorEventNoChangeID creates a new error event object with no changeID attached
func NewResponseEvent ¶
func NewResponseEvent(eventType EventType, subject string, changeID devicechange.ID, response string) DeviceResponse
NewResponseEvent creates a new response event object
type Event ¶
type Event interface { Subject() string Time() time.Time EventType() EventType Object() interface{} fmt.Stringer }
Event is a general purpose base type of event Specializations of Event are possible by extending the interface See configEvent for more details
type EventAction ¶
type EventAction int
EventAction is an enumerated type
const ( EventItemNone EventAction = iota EventItemAdded EventItemUpdated EventItemDeleted )
Values of the EventItem enumeration
type EventType ¶
type EventType int
EventType is an enumerated type
const ( EventTypeOperationalState EventType = iota EventTypeDeviceConnected EventTypeErrorParseConfig EventTypeErrorDeviceConnect EventTypeErrorDeviceCapabilities EventTypeErrorDeviceConnectInitialConfigSync EventTypeErrorDeviceDisconnect EventTypeErrorSubscribe EventTypeErrorMissingModelPlugin EventTypeErrorTranslation EventTypeErrorGetWithRoPaths EventTypeTopoUpdate )
Values of the EventType enumeration
type OperationalStateEvent ¶
type OperationalStateEvent interface { Event ItemAction() EventAction Path() string Value() *devicechange.TypedValue }
OperationalStateEvent represents an event for an update in operational state on a device
func NewOperationalStateEvent ¶
func NewOperationalStateEvent(subject string, path string, value *devicechange.TypedValue, eventAction EventAction) OperationalStateEvent
NewOperationalStateEvent creates a new operational state event object