ports

package
v0.0.0-...-0c72d35 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqttPort

type MqttPort interface {
	Connect(ctx context.Context, logger *zap.SugaredLogger, cfg *utils.Config) *autopaho.ConnectionManager
	Close(cancel context.CancelFunc, logger *zap.SugaredLogger)
	Publish(ctx context.Context, cm *autopaho.ConnectionManager, logger *zap.SugaredLogger, msgPayloads map[string]json.RawMessage, qos byte, retain bool)
}

type PgPort

type PgPort interface {

	// BuildPowerGenerators returns a slice of power-generators of length nb.
	BuildPowerGenerators(pGenerators []models.Generator, cfg *utils.Config, nb int)

	// BuildPGMessagePayloads returns a map contains the power-generator general info
	// (identification infos) with the corresponding topic.
	BuildPGMessagePayloads(sim *services.SimService, pg *models.Generator, logger *zap.SugaredLogger) map[string]json.RawMessage

	// Update used to generate/update the power-generator tags message payload.
	// it returns a map contains the pg topics with corresponding message payloads.
	Update(sim *services.SimService, pg *models.Generator, logger *zap.SugaredLogger) map[string]json.RawMessage
}

PgPort describes a service that generates power-generator data to be published to an MQTT Broker.

type SimulatorPort

type SimulatorPort interface {
	SetTemperature(payload *models.Generator)
	SetFuelLevel(payload *models.Generator)
	SetFuelUsed(payload *models.Generator)
	SetPower(payload *models.Generator)
	SetLoad(payload *models.Generator)
}

Jump to

Keyboard shortcuts

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