Documentation ¶
Index ¶
- type IMQTT
- type IManagement
- type Mqtt
- func (m *Mqtt) Management() IManagement
- func (m *Mqtt) NewClient(cfg *mqtt_client.Config) (c *mqtt_client.Client, err error)
- func (m *Mqtt) OnClose(ctx context.Context, client gmqtt.Client, err error)
- func (m *Mqtt) OnConnect(ctx context.Context, client gmqtt.Client) (code uint8)
- func (m *Mqtt) OnConnected(ctx context.Context, client gmqtt.Client)
- func (m *Mqtt) OnSessionCreated(ctx context.Context, client gmqtt.Client)
- func (m *Mqtt) OnSessionResumed(ctx context.Context, client gmqtt.Client)
- func (m *Mqtt) Publish(topic string, payload []byte, qos uint8, retain bool)
- func (m *Mqtt) Shutdown()
- type MqttBind
- type MqttConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMQTT ¶ added in v0.1.0
type IMQTT interface { Run() Stop(ctx context.Context) error // SubscriptionStore returns the subscription.Store. SubscriptionStore() subscription.Store // RetainedStore returns the retained.Store. RetainedStore() retained.Store // PublishService returns the PublishService PublishService() gmqtt.PublishService // Client return the client specified by clientID. Client(clientID string) gmqtt.Client // GetConfig returns the config of the server GetConfig() gmqtt.Config // GetStatsManager returns StatsManager GetStatsManager() gmqtt.StatsManager }
type IManagement ¶ added in v0.0.20
type IManagement interface { GetClients(limit, offset int) (list []*management.ClientInfo, total int, err error) GetClient(clientId string) (client *management.ClientInfo, err error) GetSessions(limit, offset int) (list []*management.SessionInfo, total int, err error) GetSession(clientId string) (session *management.SessionInfo, err error) GetSubscriptions(clientId string, limit, offset int) (list []*management.SubscriptionInfo, total int, err error) Subscribe(clientId, topic string, qos int) (err error) Unsubscribe(clientId, topic string) (err error) Publish(topic string, qos int, payload []byte, retain bool) (err error) CloseClient(clientId string) (err error) SearchTopic(query string) (result []*management.SubscriptionInfo, err error) }
type Mqtt ¶
type Mqtt struct {
// contains filtered or unexported fields
}
func NewMqtt ¶
func NewMqtt(cfg *MqttConfig, graceful *graceful_service.GracefulService, authenticator *mqtt_authenticator.Authenticator, scriptService *scripts.ScriptService, metric *metrics.MetricManager) (mqtt *Mqtt)
func (*Mqtt) Management ¶ added in v0.0.20
func (m *Mqtt) Management() IManagement
func (*Mqtt) NewClient ¶
func (m *Mqtt) NewClient(cfg *mqtt_client.Config) (c *mqtt_client.Client, err error)
func (*Mqtt) OnConnected ¶ added in v0.0.19
func (*Mqtt) OnSessionCreated ¶ added in v0.0.19
func (*Mqtt) OnSessionResumed ¶ added in v0.0.19
type MqttBind ¶ added in v0.0.19
type MqttBind struct {
// contains filtered or unexported fields
}
Javascript Binding
Mqtt
.Publish
func NewMqttBind ¶ added in v0.0.19
type MqttConfig ¶
type MqttConfig struct { Port int RetryInterval time.Duration RetryCheckInterval time.Duration SessionExpiryInterval time.Duration SessionExpireCheckInterval time.Duration QueueQos0Messages bool MaxInflight int MaxAwaitRel int MaxMsgQueue int }
func NewMqttConfig ¶
func NewMqttConfig(cfg *config.AppConfig) *MqttConfig
Click to show internal directories.
Click to hide internal directories.