Documentation ¶
Index ¶
Constants ¶
View Source
const ( //MQTT protocol MQTT = "mqtt" LogNone = "none" LogDebug = "debug" LogInfo = "info" LogWarning = "warning" LogError = "error" LogCritical = "critical" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MQTTNetwork ¶
type MQTTNetwork struct {
// contains filtered or unexported fields
}
MQTTNetwork Protocol MQTT
func (*MQTTNetwork) Initialize ¶
func (p *MQTTNetwork) Initialize(config NetworkConfig) error
Initialize protocol communication
func (*MQTTNetwork) SendCommand ¶
func (p *MQTTNetwork) SendCommand(topic, payload string) error
SendCommand send a command
type NetworkConfig ¶
type NetworkConfig struct { IP string Port string Callbacks map[string]func(Client, Message) LogLevel string User string //for authentification Password string CaPath string Secure bool }
NetworkConfig configuration structure
type NetworkInterface ¶
type NetworkInterface interface { Disconnect() SendCommand(string, string) error Initialize(config NetworkConfig) error }
NetworkInterface network abstraction layer
func NewNetwork ¶
func NewNetwork(protocol string) (NetworkInterface, error)
NewNetwork instanciate the appropriate networkinterface
Click to show internal directories.
Click to hide internal directories.