blasters

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 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 MQTTBlaster

type MQTTBlaster struct {
	*station.Station
	Topic string
}

MQTTBlaster is a virtual station that will spew messages to a given topic to be used for testing.

type MQTTBlasters

type MQTTBlasters struct {
	Count    int
	Blasters []*MQTTBlaster
	Running  bool
	Wait     int
}

MQTTBlasters is a collection of blaster stations that will spew messages from each of the different stations.

func NewMQTTBlasters

func NewMQTTBlasters(count int) *MQTTBlasters

NewMQTTBlasters will create a count number of blasters ready to blast MQTT messages

func (*MQTTBlasters) Blast

func (mb *MQTTBlasters) Blast() error

Blast will start the configured blasters to start blasting messages.

func (*MQTTBlasters) Stop

func (mb *MQTTBlasters) Stop()

Stop will cause the blasters to stop blasting.

type MsgMaker

type MsgMaker interface {
	NewMsg() *messanger.Msg
}

MsgMaker creates messages to be used by the mqtt blaster for smoke testing the messaging subsystem

type WeatherData

type WeatherData struct {
	Tempc    float32 `json:"tempc"`
	Humidity float32 `json:"humidity"`
}

WeatherData is the content contained in the message used by the blaster

func (*WeatherData) NewMsg

func (w *WeatherData) NewMsg(topic string) *messanger.Msg

NewMsg will create a new message for testing

Jump to

Keyboard shortcuts

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