Documentation
¶
Index ¶
- Constants
- Variables
- func AppendNodeUpdateACL(hostID, nodeNetwork, nodeID, serverName string) error
- func ClientPeerUpdate(client mqtt.Client, msg mqtt.Message)
- func CloseClient()
- func CreateDefaultDenyRule() error
- func CreateEmqxDefaultAuthenticator() error
- func CreateEmqxDefaultAuthorizer() error
- func CreateEmqxUser(username, password string, admin bool) error
- func CreateHostACL(hostID, serverName string) error
- func DecryptMsg(node *models.Node, msg []byte) ([]byte, error)
- func DefaultHandler(client mqtt.Client, msg mqtt.Message)
- func DeleteEmqxUser(username string) error
- func GetID(topic string) (string, error)
- func GetUserACL(username string) (*aclObject, error)
- func HandleHostCheckin(h, currentHost *models.Host) bool
- func HostUpdate(hostUpdate *models.HostUpdate) error
- func IsConnected() bool
- func Keepalive(ctx context.Context)
- func NodeUpdate(node *models.Node) error
- func PublishDeletedClientPeerUpdate(delClient *models.ExtClient) error
- func PublishDeletedNodePeerUpdate(delNode *models.Node) error
- func PublishMqUpdatesForDeletedNode(node models.Node, sendNodeUpdate bool, gwClients []models.ExtClient)
- func PublishPeerUpdate(replacePeers bool) error
- func PublishSingleHostPeerUpdate(host *models.Host, allNodes []models.Node, deletedNode *models.Node, ...) error
- func PushMetricsToExporter(metrics models.Metrics) error
- func ServerStartNotify() error
- func SetupMQTT()
- func UpdateHost(client mqtt.Client, msg mqtt.Message)
- func UpdateNode(client mqtt.Client, msg mqtt.Message)
Constants ¶
const KEEPALIVE_TIMEOUT = 60 //timeout in seconds
KEEPALIVE_TIMEOUT - time in seconds for timeout
const MQ_DISCONNECT = 250
MQ_DISCONNECT - disconnects MQ
const MQ_TIMEOUT = 30
MQ_TIMEOUT - timeout for MQ
Variables ¶
var UpdateMetrics = func(client mqtt.Client, msg mqtt.Message) {
}
UpdateMetrics message Handler -- handles updates from client nodes for metrics
var UpdateMetricsFallBack = func(nodeid string, newMetrics models.Metrics) {}
Functions ¶
func AppendNodeUpdateACL ¶
AppendNodeUpdateACL - adds ACL rule for subscribing to node updates for a node ID
func ClientPeerUpdate ¶
ClientPeerUpdate message handler -- handles updating peers after signal from client nodes
func CreateDefaultDenyRule ¶
func CreateDefaultDenyRule() error
CreateDefaultDenyRule - creates a rule to deny access to all topics for all users by default to allow user access to topics use the `mq.CreateUserAccessRule` function
func CreateEmqxDefaultAuthenticator ¶
func CreateEmqxDefaultAuthenticator() error
CreateEmqxDefaultAuthenticator - creates a default authenticator based on password and using EMQX's built in database as storage
func CreateEmqxDefaultAuthorizer ¶
func CreateEmqxDefaultAuthorizer() error
CreateEmqxDefaultAuthorizer - creates a default ACL authorization mechanism based on the built in database
func CreateEmqxUser ¶
CreateEmqxUser - creates an EMQX user
func CreateHostACL ¶
CreateHostACL - create host ACL rules
func DefaultHandler ¶
DefaultHandler default message queue handler -- NOT USED
func DeleteEmqxUser ¶
DeleteEmqxUser - deletes an EMQX user
func GetUserACL ¶
GetUserACL - returns ACL rules by username
func HandleHostCheckin ¶ added in v0.22.0
func HostUpdate ¶
func HostUpdate(hostUpdate *models.HostUpdate) error
HostUpdate -- publishes a host update to clients
func IsConnected ¶
func IsConnected() bool
IsConnected - function for determining if the mqclient is connected or not
func Keepalive ¶
Keepalive -- periodically pings all nodes to let them know server is still alive and doing well
func PublishDeletedClientPeerUpdate ¶
PublishDeletedClientPeerUpdate --- determines and publishes a peer update to all the hosts with a deleted ext client to account for
func PublishDeletedNodePeerUpdate ¶
PublishDeletedNodePeerUpdate --- determines and publishes a peer update to all the hosts with a deleted node to account for
func PublishMqUpdatesForDeletedNode ¶ added in v0.21.2
func PublishMqUpdatesForDeletedNode(node models.Node, sendNodeUpdate bool, gwClients []models.ExtClient)
PublishMqUpdatesForDeletedNode - published all the required updates for deleted node
func PublishPeerUpdate ¶
PublishPeerUpdate --- determines and publishes a peer update to all the hosts
func PublishSingleHostPeerUpdate ¶
func PublishSingleHostPeerUpdate(host *models.Host, allNodes []models.Node, deletedNode *models.Node, deletedClients []models.ExtClient, replacePeers bool) error
PublishSingleHostPeerUpdate --- determines and publishes a peer update to one host
func PushMetricsToExporter ¶
func ServerStartNotify ¶
func ServerStartNotify() error
ServerStartNotify - notifies all non server nodes to pull changes after a restart
func UpdateHost ¶
UpdateHost message Handler -- handles host updates from clients
Types ¶
This section is empty.