Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ID string
Username string
Password []byte
Cert x509.Certificate
}
Client stores MQTT client data.
type Handler ¶
type Handler interface {
// Authorization on client `CONNECT`
// Each of the params are passed by reference, so that it can be changed
AuthConnect(client *Client) error
// Authorization on client `PUBLISH`
// Topic is passed by reference, so that it can be modified
AuthPublish(client *Client, topic *string, payload *[]byte) error
// Authorization on client `SUBSCRIBE`
// Topics are passed by reference, so that they can be modified
AuthSubscribe(client *Client, topics *[]string) error
// After client successfully connected
Connect(client *Client)
// After client successfully published
Publish(client *Client, topic *string, payload *[]byte)
// After client successfully subscribed
Subscribe(client *Client, topics *[]string)
// After client unsubscribed
Unsubscribe(client *Client, topics *[]string)
// Disconnect on connection with client lost
Disconnect(client *Client)
}
Handler is an interface for mProxy hooks
type Session ¶
type Session struct {
Client Client
// contains filtered or unexported fields
}
Session represents MQTT Proxy session between client and broker.
Click to show internal directories.
Click to hide internal directories.