client

package
v0.1.0-M4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2023 License: Apache-2.0, EPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrokerConfig

type BrokerConfig struct {
	Broker     string `json:"broker"`
	Username   string `json:"username"`
	Password   string `json:"password"`
	CaCert     string `json:"caCert,omitempty"`
	ClientCert string `json:"clientCert,omitempty"`
	ClientKey  string `json:"clientKey,omitempty"`
}

BrokerConfig contains address and credentials for the MQTT broker

func (*BrokerConfig) Validate

func (b *BrokerConfig) Validate() error

Validate validates the Broker config.

type EdgeConfiguration

type EdgeConfiguration struct {
	DeviceID string `json:"deviceId"`
	TenantID string `json:"tenantId"`
	PolicyID string `json:"policyId"`
}

EdgeConfiguration represents local Edge Thing configuration - its device, tenant and policy identifiers.

type EdgeConnector

type EdgeConnector interface {
	// Update updates the MQTT client and/or the configurations of the connector and connects it.
	Update(mqttClient MQTT.Client, edgeConfig *EdgeConfiguration)
	// Close disconnects the connector and the MQTT client and cleans up used resources.
	Close()
}

EdgeConnector declares update and close function for every edge client.

type EdgeManager

type EdgeManager struct {
	// contains filtered or unexported fields
}

EdgeManager represents the EdgeConnector used for connection with its configurations.

func NewEdgeManager

func NewEdgeManager(config *BrokerConfig, edgeConnector EdgeConnector) (*EdgeManager, error)

NewEdgeManager creates EdgeManager with the given BrokerConfig and sets up a listener for EdgeConfiguration changes.

func (*EdgeManager) Close

func (edgeManager *EdgeManager) Close()

Close closes the EdgeConnector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL