mqtt

package
v0.0.0-...-68d2f45 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TLSConfig

func TLSConfig(skipVerify bool, caFile string) *tls.Config

Types

type MQTT

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

MQTT sends points from the store to a MQTT server.

func New

func New(opts Options) *MQTT

func (*MQTT) DiagnosticArchive

func (m *MQTT) DiagnosticArchive(ctx context.Context, archive types.ArchiveWriter) error

DiagnosticArchive add to a zipfile useful diagnostic information.

func (*MQTT) PopPoints

func (m *MQTT) PopPoints() []types.MetricPoint

PopPoints returns the list of metrics to be sent.

func (*MQTT) Run

func (m *MQTT) Run(ctx context.Context) error

Run starts periodically sending metric points to MQTT.

type Options

type Options struct {
	Config config.OpenSourceMQTT
	FQDN   string
	// State kept between reloads.
	ReloadState types.MQTTReloadState
	// The store provides the metrics to send to MQTT.
	Store               Store
	PahoLastPingCheckAt func() time.Time
}

type Store

type Store interface {
	AddNotifiee(cb func([]types.MetricPoint)) int
	RemoveNotifiee(id int)
}

Store is the interface used by the client to access the Metric Store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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