mqtt_tunnel

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMQTTBroker       = "test-broker"
	DefaultMQTTUsername     = "test-username"
	DefaultMQTTPassword     = "public"
	DefaultMQTTClientPrefix = "koupleless"
	DefaultMQTTPort         = 1883
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ArkMqttMsg

type ArkMqttMsg[T any] struct {
	PublishTimestamp int64 `json:"publishTimestamp"`
	Data             T     `json:"data"`
}

ArkMqttMsg is the response of mqtt message payload.

type MqttConfig

type MqttConfig struct {
	MqttBroker        string
	MqttPort          int
	MqttUsername      string
	MqttPassword      string
	MqttClientPrefix  string
	MqttCAPath        string
	MqttClientCrtPath string
	MqttClientKeyPath string
}

type MqttTunnel

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

func (*MqttTunnel) FetchHealthData

func (m *MqttTunnel) FetchHealthData(_ context.Context, baseID string) error

func (*MqttTunnel) InstallBiz

func (m *MqttTunnel) InstallBiz(_ context.Context, deviceID string, bizModel *ark.BizModel) error

func (*MqttTunnel) Name

func (m *MqttTunnel) Name() string

func (*MqttTunnel) OnBaseStart

func (m *MqttTunnel) OnBaseStart(ctx context.Context, baseID string)

func (*MqttTunnel) OnBaseStop

func (m *MqttTunnel) OnBaseStop(ctx context.Context, baseID string)

func (*MqttTunnel) QueryAllBizData

func (m *MqttTunnel) QueryAllBizData(_ context.Context, baseID string) error

func (*MqttTunnel) Register

func (m *MqttTunnel) Register(ctx context.Context, clientID string, baseDiscoveredCallback tunnel.BaseDiscoveredCallback, healthDataArrivedCallback tunnel.HealthDataArrivedCallback, queryAllBizDataArrivedCallback tunnel.QueryAllBizDataArrivedCallback) (err error)

func (*MqttTunnel) UninstallBiz

func (m *MqttTunnel) UninstallBiz(_ context.Context, deviceID string, bizModel *ark.BizModel) error

Jump to

Keyboard shortcuts

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