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 HandleNewNodeDNS(host *models.Host, node *models.Node) error
- func HostUpdate(hostUpdate *models.HostUpdate) error
- func IsConnected() bool
- func Keepalive(ctx context.Context)
- func NodeUpdate(node *models.Node) error
- func PublishAllDNS(newnode *models.Node) error
- func PublishCustomDNS(entry *models.DNSEntry) error
- func PublishDNSDelete(node *models.Node, host *models.Host) error
- func PublishDNSUpdate(network string, dns models.DNSUpdate) error
- func PublishDNSUpdatev1(network string, dns models.DNSUpdate, nodes []models.Node) error
- func PublishDeleteAllExtclientsDNS(network string, clients []models.ExtClient) error
- func PublishDeleteExtClientDNS(client *models.ExtClient) error
- func PublishDeletedClientPeerUpdate(delClient *models.ExtClient) error
- func PublishDeletedNodePeerUpdate(delNode *models.Node) error
- func PublishExtClientDNS(client *models.ExtClient) error
- func PublishExtClientDNSUpdate(old, new models.ExtClient, network string) error
- func PublishHostDNSUpdate(old, new *models.Host, networks []string) error
- func PublishMqUpdatesForDeletedNode(node models.Node, sendNodeUpdate bool, gwClients []models.ExtClient)
- func PublishPeerUpdate() error
- func PublishReplaceDNS(oldNode, newNode *models.Node, host *models.Host) 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
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 HandleNewNodeDNS ¶ added in v0.21.2
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 PublishAllDNS ¶
PublishAllDNS publishes an array of dns updates (ip / host.network) for each peer to a node joining a network
func PublishCustomDNS ¶
PublishCustomDNS publish dns update for new custom dns entry
func PublishDNSDelete ¶
PublishDNSDelete publish a dns update deleting a node to all hosts on a network
func PublishDNSUpdate ¶
PublishDNSUpdate publishes a dns update to all nodes on a network
func PublishDNSUpdatev1 ¶ added in v0.21.2
PublishDNSUpdatev1 - published dns updates to all nodes passed
func PublishDeleteAllExtclientsDNS ¶ added in v0.21.2
PublishDeleteAllExtclientsDNS - publish to delete all passed ext clients dns entries
func PublishDeleteExtClientDNS ¶
PublishDeleteExtClientDNS publish dns update to delete extclient entry
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 PublishExtClientDNS ¶
PublishExtClientDNS publish dns update for new extclient
func PublishExtClientDNSUpdate ¶
PublishExtClientDNSUpdate update for extclient name change
func PublishHostDNSUpdate ¶
PublishHostDNSUpdate publishes dns update on host name change
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 ¶
func PublishPeerUpdate() error
PublishPeerUpdate --- determines and publishes a peer update to all the hosts
func PublishReplaceDNS ¶
PublishReplaceDNS publish a dns update to replace a dns entry on all hosts in network
func PublishSingleHostPeerUpdate ¶
func PublishSingleHostPeerUpdate(host *models.Host, allNodes []models.Node, deletedNode *models.Node, deletedClients []models.ExtClient) 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.