Documentation
¶
Index ¶
- func NewClient(host, username, passwd string) func(opts ...Option) Client
- type Client
- type Message
- type MessageHandler
- type MqttClient
- func (mc *MqttClient) Close()
- func (mc *MqttClient) Connect() (err error)
- func (mc *MqttClient) PublishAttribute(ctx context.Context, payload interface{}) error
- func (mc *MqttClient) PublishGatewayAttribute(ctx context.Context, payload interface{}) error
- func (mc *MqttClient) PublishGatewayTelemetry(ctx context.Context, payload interface{}) error
- func (mc *MqttClient) PublishRaw(ctx context.Context, payload interface{}) error
- func (mc *MqttClient) PublishRpcResponse(ctx context.Context, commandName, requestId string, payload interface{}) error
- func (mc *MqttClient) PublishTelemetry(ctx context.Context, payload interface{}) error
- func (mc *MqttClient) SubscribeRpcReq(ctx context.Context, handler MessageHandler) error
- type Option
- type RpcPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { // PublishRaw for publish raw msg PublishRaw(ctx context.Context, payload interface{}) error // PublishTelemetry for publish telemetry msg PublishTelemetry(ctx context.Context, payload interface{}) error // PublishAttribute for publish attribute msg PublishAttribute(ctx context.Context, payload interface{}) error // PublishTelemetry for publish telemetry msg PublishGatewayTelemetry(ctx context.Context, payload interface{}) error // PublishAttribute for publish attribute msg PublishGatewayAttribute(ctx context.Context, payload interface{}) error SubscribeRpcReq(ctx context.Context, handler MessageHandler) error PublishRpcResponse(ctx context.Context, commandName, requestId string, payload interface{}) error // Close client Close() // Connect to IoT Hub Connect() (err error) }
Client is the interface for device-sdk-go client implementation.
type MessageHandler ¶
type MqttClient ¶
type MqttClient struct {
// contains filtered or unexported fields
}
func (*MqttClient) Close ¶
func (mc *MqttClient) Close()
func (*MqttClient) Connect ¶
func (mc *MqttClient) Connect() (err error)
Connect returns true if connection to mqtt is established
func (*MqttClient) PublishAttribute ¶
func (mc *MqttClient) PublishAttribute(ctx context.Context, payload interface{}) error
func (*MqttClient) PublishGatewayAttribute ¶
func (mc *MqttClient) PublishGatewayAttribute(ctx context.Context, payload interface{}) error
func (*MqttClient) PublishGatewayTelemetry ¶
func (mc *MqttClient) PublishGatewayTelemetry(ctx context.Context, payload interface{}) error
func (*MqttClient) PublishRaw ¶
func (mc *MqttClient) PublishRaw(ctx context.Context, payload interface{}) error
func (*MqttClient) PublishRpcResponse ¶
func (mc *MqttClient) PublishRpcResponse(ctx context.Context, commandName, requestId string, payload interface{}) error
func (*MqttClient) PublishTelemetry ¶
func (mc *MqttClient) PublishTelemetry(ctx context.Context, payload interface{}) error
func (*MqttClient) SubscribeRpcReq ¶
func (mc *MqttClient) SubscribeRpcReq(ctx context.Context, handler MessageHandler) error
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithAutoReconnect ¶
WithAutoReconnect SetAutoReconnect sets the MQTT AutoReconnect setting
func WithServerCert ¶
func WithUseSSL ¶
type RpcPayload ¶
Click to show internal directories.
Click to hide internal directories.