Documentation
¶
Overview ¶
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Copyright (c) Microsoft Corporation. Licensed under the MIT License.
Index ¶
- type Ack
- type ConnectEvent
- type ConnectEventHandler
- type DisconnectEvent
- type DisconnectEventHandler
- type Message
- type MessageHandler
- type PublishOption
- type PublishOptions
- type SubscribeOption
- type SubscribeOptions
- type UnsubscribeOption
- type UnsubscribeOptions
- type WithContentType
- type WithCorrelationData
- type WithMessageExpiry
- type WithNoLocal
- type WithPayloadFormat
- type WithQoS
- type WithResponseTopic
- type WithRetain
- type WithRetainHandling
- type WithUserProperties
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnectEvent ¶
type ConnectEvent struct {
ReasonCode byte
}
ConnectEvent contains the relevent metadata provided to the handler when the MQTT client connects to the broker.
type ConnectEventHandler ¶
type ConnectEventHandler = func(*ConnectEvent)
ConnectEventHandler is a user-defined callback function used to respond to connection notifications from the MQTT client.
type DisconnectEvent ¶
DisconnectEvent contains the relevent metadata provided to the handler when the MQTT client disconnects from the broker.
type DisconnectEventHandler ¶
type DisconnectEventHandler = func(*DisconnectEvent)
DisconnectEventHandler is a user-defined callback function used to respond to disconnection notifications from the MQTT client.
type Message ¶
type Message struct { Topic string Payload []byte PublishOptions // Ack will manually ack the message. All handled messages must be acked // (except for QoS 0 messages, in which case this is a no-op). Ack func() }
Message represents a received message.
type MessageHandler ¶
MessageHandler is a user-defined callback function used to handle messages received on the subscribed topic.
type PublishOption ¶
type PublishOption interface {
// contains filtered or unexported methods
}
PublishOption represents a single publish option.
type PublishOptions ¶
type PublishOptions struct { ContentType string CorrelationData []byte MessageExpiry uint32 PayloadFormat byte QoS byte ResponseTopic string Retain bool UserProperties map[string]string }
PublishOptions are the resolved publish options.
func (*PublishOptions) Apply ¶
func (o *PublishOptions) Apply( opts []PublishOption, rest ...PublishOption, )
Apply resolves the provided list of options.
type SubscribeOption ¶
type SubscribeOption interface {
// contains filtered or unexported methods
}
SubscribeOption represents a single subscribe option.
type SubscribeOptions ¶
type SubscribeOptions struct { NoLocal bool QoS byte Retain bool RetainHandling byte UserProperties map[string]string }
SubscribeOptions are the resolved subscribe options.
func (*SubscribeOptions) Apply ¶
func (o *SubscribeOptions) Apply( opts []SubscribeOption, rest ...SubscribeOption, )
Apply resolves the provided list of options.
type UnsubscribeOption ¶
type UnsubscribeOption interface {
// contains filtered or unexported methods
}
UnsubscribeOption represents a single unsubscribe option.
type UnsubscribeOptions ¶
UnsubscribeOptions are the resolve unsubscribe options.
func (*UnsubscribeOptions) Apply ¶
func (o *UnsubscribeOptions) Apply( opts []UnsubscribeOption, rest ...UnsubscribeOption, )
Apply resolves the provided list of options.
type WithContentType ¶
type WithContentType string
WithContentType sets the content type for the publish.
type WithCorrelationData ¶
type WithCorrelationData []byte
WithCorrelationData sets the correlation data for the publish.
type WithMessageExpiry ¶
type WithMessageExpiry uint32
WithMessageExpiry sets the message expiry interval for the publish.
type WithPayloadFormat ¶
type WithPayloadFormat byte
WithPayloadFormat sets the payload format indicator for the publish.
type WithResponseTopic ¶
type WithResponseTopic string
WithResponseTopic sets the response topic for the publish.
type WithRetain ¶
type WithRetain bool
WithRetain sets the retain flag for the publish or the retain-as-publish flag for the subscribe.
type WithRetainHandling ¶
type WithRetainHandling byte
WithRetainHandling specifies the handling of retained messages on the subscribe.
type WithUserProperties ¶
WithUserProperties sets the user properties for the publish or subscribe.