Documentation ¶
Index ¶
- Constants
- type Http2Mqtt
- func (h *Http2Mqtt) EnableProfiling(enable bool)
- func (h *Http2Mqtt) EnableStream(status bool)
- func (h *Http2Mqtt) GetMqttClient() *MQTT.Client
- func (h *Http2Mqtt) GetStreamChannel() chan MQTT.Message
- func (h *Http2Mqtt) GetSubscriptions() []SubScribeMessage
- func (h *Http2Mqtt) Run(addrHttp string)
- func (s *Http2Mqtt) SetGinAuth(user string, password string)
- func (h *Http2Mqtt) SetStreamChannel(ch chan MQTT.Message)
- func (m *Http2Mqtt) SubscribeTopic(msg SubScribeMessage) error
- type Http2MqttOption
- type PublishMessage
- type SubScribeMessage
- type WsHandler
Constants ¶
View Source
const MaxClientIdLen = 14
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Http2Mqtt ¶
type Http2Mqtt struct { Router *gin.Engine Group *gin.RouterGroup MqttBrokerURL string // contains filtered or unexported fields }
func New ¶
func New(mqttOpts *MQTT.ClientOptions, opts ...Http2MqttOption) *Http2Mqtt
func (*Http2Mqtt) EnableProfiling ¶
func (*Http2Mqtt) EnableStream ¶
func (*Http2Mqtt) GetMqttClient ¶
func (*Http2Mqtt) GetStreamChannel ¶
func (*Http2Mqtt) GetSubscriptions ¶
func (h *Http2Mqtt) GetSubscriptions() []SubScribeMessage
func (*Http2Mqtt) SetGinAuth ¶
func (*Http2Mqtt) SetStreamChannel ¶
func (*Http2Mqtt) SubscribeTopic ¶
func (m *Http2Mqtt) SubscribeTopic(msg SubScribeMessage) error
type Http2MqttOption ¶
type Http2MqttOption func(*Http2Mqtt)
func WithOptionPrefix ¶
func WithOptionPrefix(prefix string) Http2MqttOption
func WithOptionRouter ¶
func WithOptionRouter(router *gin.Engine) Http2MqttOption
func WithOptionRouterGroup ¶
func WithOptionRouterGroup(group *gin.RouterGroup) Http2MqttOption
type PublishMessage ¶
type PublishMessage struct { Topic string `binding:"required" json:"topic"` Message json.RawMessage `binding:"required" json:"data"` Qos byte `json:"qos"` Retained bool `json:"retained"` }
PublishMessage is the sample data transfer object for publish http route
type SubScribeMessage ¶
Click to show internal directories.
Click to hide internal directories.