Documentation ¶
Index ¶
- type AuthHandler
- type Broker
- func (b *Broker) Publish(topic string, payload []byte, qos byte, retain bool) error
- func (b *Broker) PublishPV(topic string, pv veap.PV, qos byte, retain bool) error
- func (b *Broker) Start()
- func (b *Broker) Stop()
- func (b *Broker) Subscribe(topic string, qos byte, onPublish *service.OnPublishFunc) error
- func (b *Broker) Unsubscribe(topic string, onPublish *service.OnPublishFunc) error
- type EventReceiver
- func (r *EventReceiver) DeleteDevices(interfaceID string, addresses []string) error
- func (r *EventReceiver) Event(interfaceID, address, valueKey string, value interface{}) error
- func (r *EventReceiver) NewDevices(interfaceID string, devDescriptions []*itf.DeviceDescription) error
- func (r *EventReceiver) ReaddedDevice(interfaceID string, deletedAddresses []string) error
- func (r *EventReceiver) ReplaceDevice(interfaceID, oldDeviceAddress, newDeviceAddress string) error
- func (r *EventReceiver) UpdateDevice(interfaceID, address string, hint int) error
- type SysVarReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶ added in v0.10.0
AuthHandler handles MQTT client authentication.
func (*AuthHandler) Authenticate ¶ added in v0.10.0
func (a *AuthHandler) Authenticate(id string, cred interface{}) error
Authenticate implements auth.Authenticator.
type Broker ¶
type Broker struct { // Binding address for serving MQTT. Addr string // Binding address for serving Secure MQTT. AddrTLS string // Certificate file for Secure MQTT. CertFile string // Private key file for Secure MQTT. KeyFile string // Authenticator specifies the authenticator. Default is "mockSuccess". Authenticator string // When an error happens while serving (e.g. binding of port fails), this // error is sent to the channel ServeErr. ServeErr chan<- error // Service is used to write device data points and read/write system variables. Service veap.Service // contains filtered or unexported fields }
Broker for MQTT. Broker implements itf.Receiver to receive XML-RPC events.
func (*Broker) Unsubscribe ¶ added in v0.9.0
func (b *Broker) Unsubscribe(topic string, onPublish *service.OnPublishFunc) error
Unsubscribe unsubscribes a topic.
type EventReceiver ¶ added in v0.7.2
type EventReceiver struct { // Broker for publishing events. Broker *Broker // Next handler for XML-RPC events. Next itf.LogicLayer }
EventReceiver accepts XMLRPC events, publishes them to the broker and then forwards them to the next receiver.
func (*EventReceiver) DeleteDevices ¶ added in v0.7.2
func (r *EventReceiver) DeleteDevices(interfaceID string, addresses []string) error
DeleteDevices implements itf.Receiver.
func (*EventReceiver) Event ¶ added in v0.7.2
func (r *EventReceiver) Event(interfaceID, address, valueKey string, value interface{}) error
Event implements itf.Receiver.
func (*EventReceiver) NewDevices ¶ added in v0.7.2
func (r *EventReceiver) NewDevices(interfaceID string, devDescriptions []*itf.DeviceDescription) error
NewDevices implements itf.Receiver.
func (*EventReceiver) ReaddedDevice ¶ added in v0.7.2
func (r *EventReceiver) ReaddedDevice(interfaceID string, deletedAddresses []string) error
ReaddedDevice implements itf.Receiver.
func (*EventReceiver) ReplaceDevice ¶ added in v0.7.2
func (r *EventReceiver) ReplaceDevice(interfaceID, oldDeviceAddress, newDeviceAddress string) error
ReplaceDevice implements itf.Receiver.
func (*EventReceiver) UpdateDevice ¶ added in v0.7.2
func (r *EventReceiver) UpdateDevice(interfaceID, address string, hint int) error
UpdateDevice implements itf.Receiver.
type SysVarReader ¶ added in v1.0.0
type SysVarReader struct { // Service is used to explore the system variables. Service veap.Service // ScriptClient is used to bulk read system variables. ScriptClient *script.Client // Broker is used for publishing value changes. Broker *Broker // contains filtered or unexported fields }
SysVarReader reads cyclic system variables.
func (*SysVarReader) Start ¶ added in v1.0.0
func (r *SysVarReader) Start()
Start starts the system variable reader.
func (*SysVarReader) Stop ¶ added in v1.0.0
func (r *SysVarReader) Stop()
Stop stops the system variable reader.