Documentation ¶
Index ¶
- type Client
- type ClientStruct
- func (c *ClientStruct) AddRoute(subscribeTopic string, messageHandler MessageHandler)
- func (c *ClientStruct) GetCtx() context.Context
- func (c *ClientStruct) Name() string
- func (c *ClientStruct) Publish(topic string, payload []byte, qos byte, retain bool)
- func (c *ClientStruct) Run()
- func (c *ClientStruct) Shutdown()
- type Config
- type Message
- type MessageHandler
- type MqttSectionConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientStruct ¶
type ClientStruct struct {
// contains filtered or unexported fields
}
func NewV5 ¶
func NewV5( cfg Config, ) (client *ClientStruct)
func (*ClientStruct) AddRoute ¶
func (c *ClientStruct) AddRoute(subscribeTopic string, messageHandler MessageHandler)
func (*ClientStruct) GetCtx ¶
func (c *ClientStruct) GetCtx() context.Context
func (*ClientStruct) Name ¶
func (c *ClientStruct) Name() string
func (*ClientStruct) Publish ¶
func (c *ClientStruct) Publish(topic string, payload []byte, qos byte, retain bool)
func (*ClientStruct) Run ¶
func (c *ClientStruct) Run()
func (*ClientStruct) Shutdown ¶
func (c *ClientStruct) Shutdown()
type Config ¶
type Config interface { Name() string Broker() *url.URL User() string Password() string ClientId() string KeepAlive() time.Duration ConnectRetryDelay() time.Duration ConnectTimeout() time.Duration TopicPrefix() string ReadOnly() bool MaxBacklogSize() int AvailabilityClient() MqttSectionConfig AvailabilityClientTopic() string LogDebug() bool LogMessages() bool }
type MessageHandler ¶
type MessageHandler func(Message)
Click to show internal directories.
Click to hide internal directories.