Documentation ¶
Index ¶
- Variables
- type Mqtt
- func (m *Mqtt) Close(client paho.Client, timeout uint)
- func (m *Mqtt) Connect(servers []string, user, password string, cleansess bool, clientid string, ...) paho.Client
- func (m *Mqtt) Consume(token chan paho.Message, timeout uint) string
- func (m *Mqtt) Publish(client paho.Client, topic string, qos int, message string, retain bool, ...)
- func (m *Mqtt) Subscribe(client paho.Client, topic string, qos, timeout uint) chan paho.Message
- type MqttInstance
- type MqttModule
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorConnect = errors.New("connection failed") ErrorState = errors.New("invalid state") ErrorClient = errors.New("invalid client given") ErrorTimeout = errors.New("operation timeout") ErrorSubscribe = errors.New("subscribe failure") ErrorConsumeToken = errors.New("invalid consume token") ErrorPublish = errors.New("publish failure") )
Functions ¶
This section is empty.
Types ¶
type Mqtt ¶
type Mqtt struct {
// contains filtered or unexported fields
}
TODO improve this StartTime is not a good way Mqtt is the objet to be used in tests
func (*Mqtt) Connect ¶
func (m *Mqtt) Connect( servers []string, user, password string, cleansess bool, clientid string, timeout uint, enableSsl bool, certPath string, ) paho.Client
Connect create a connection to mqtt
type MqttInstance ¶
type MqttInstance struct { // Mqtt is the exported module instance. *Mqtt // contains filtered or unexported fields }
Mqtt represents an instance of the JS module.
func (*MqttInstance) Exports ¶
func (m *MqttInstance) Exports() modules.Exports
type MqttModule ¶
type MqttModule struct{}
MqttModule is the global module instance that will create Mqtt instances for each VU.
func (*MqttModule) NewModuleInstance ¶
func (*MqttModule) NewModuleInstance(vu modules.VU) modules.Instance
a new instance for each VU.
Click to show internal directories.
Click to hide internal directories.