Documentation
¶
Index ¶
- func CreateConnection(ctx api.StreamContext, props map[string]any) (modules.Connection, error)
- type Connection
- func (conn *Connection) Close(ctx api.StreamContext) error
- func (conn *Connection) DetachSub(ctx api.StreamContext, props map[string]any)
- func (conn *Connection) Ping(ctx api.StreamContext) error
- func (conn *Connection) Publish(topic string, qos byte, retained bool, payload any) error
- func (conn *Connection) Subscribe(topic string, info *SubscriptionInfo) error
- type ConnectionConfig
- type SubscriptionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConnection ¶
func CreateConnection(ctx api.StreamContext, props map[string]any) (modules.Connection, error)
Types ¶
type Connection ¶
func CreateAnonymousConnection ¶
func CreateAnonymousConnection(ctx api.StreamContext, props map[string]any) (*Connection, error)
func CreateClient ¶
func CreateClient(ctx api.StreamContext, props map[string]any) (*Connection, error)
CreateClient creates a new mqtt client. It is anonymous and does not require a name.
func (*Connection) Close ¶
func (conn *Connection) Close(ctx api.StreamContext) error
func (*Connection) DetachSub ¶
func (conn *Connection) DetachSub(ctx api.StreamContext, props map[string]any)
Do not call this directly. Call connection pool Detach method to release the connection
func (*Connection) Ping ¶
func (conn *Connection) Ping(ctx api.StreamContext) error
func (*Connection) Subscribe ¶
func (conn *Connection) Subscribe(topic string, info *SubscriptionInfo) error
type ConnectionConfig ¶
type ConnectionConfig struct { Server string `json:"server"` PVersion string `json:"protocolVersion"` ClientId string `json:"clientid"` Uname string `json:"username"` Password string `json:"password"` // contains filtered or unexported fields }
func ValidateConfig ¶
func ValidateConfig(props map[string]any) (*ConnectionConfig, error)
type SubscriptionInfo ¶
type SubscriptionInfo struct { Qos byte Handler pahoMqtt.MessageHandler ErrHandler func(error) }
Click to show internal directories.
Click to hide internal directories.