Documentation ¶
Index ¶
- Variables
- type Mqtt
- func (*Mqtt) Close(ctx context.Context, client paho.Client, timeout uint)
- func (*Mqtt) Connect(ctx context.Context, servers []string, user, password string, cleansess bool, ...) paho.Client
- func (*Mqtt) Consume(ctx context.Context, token chan paho.Message, timeout uint) string
- func (*Mqtt) Publish(ctx context.Context, client paho.Client, topic string, qos int, message string, ...)
- func (*Mqtt) Subscribe(ctx context.Context, client paho.Client, topic string, qos, timeout uint) chan paho.Message
Constants ¶
This section is empty.
Variables ¶
View Source
var ( 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 { }
Mqtt is the objet to be used in tests
func (*Mqtt) Connect ¶
func (*Mqtt) Connect( ctx context.Context, servers []string, user, password string, cleansess bool, clientid string, timeout uint, certPath string, ) paho.Client
Connect create a connection to mqtt
Click to show internal directories.
Click to hide internal directories.