routing

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueueSensorMeasurements   = "sensor.all.measurements.db_writer" // could be subjected to a sensor id though
	QueueSensorCommandsFormat = "sensor.%s.commands"                // subjected to sensor id
	QueueSensorRegistry       = "sensor.all.registry.created"       // could scale up to sensor.all.registry.notifier ??
	QueueSensorLogs           = "sensor.all.logs"
)

Queues follow pattern: entity.id.consumer.type

View Source
const (
	KeySensorMeasurements   = "sensor.%s.measurements"
	KeySensorCommandsFormat = "sensor.%s.commands"
	KeySensorRegistryFormat = "sensor.%s.registry"
	KeySensorLogsFormat     = "sensor.%s.logs"
)

keys are used in consumers with wildcards and in publishers with the specific value

View Source
const (
	ExchangeTopicIoT = "iot" // would be great to test as a direct exchange since it should be faster
)

Exchange

Variables

View Source
var (
	RabbitConnString = os.Getenv("RABBIT_CONN_STRING")
)

PubSub Broker

Functions

This section is empty.

Types

type Sensor

type Sensor struct {
	SerialNumber    string
	SampleFrequency float64
}

registry service

type SensorCommandMessage

type SensorCommandMessage struct {
	SerialNumber string
	Timestamp    time.Time
	Command      string                 // intended for 'sleep' 'awake' 'changeSampleFrequency'
	Params       map[string]interface{} // command specific parameters e.g. {"sampleFrequency": 1000}
}

iotctl service

type SensorLog

type SensorLog struct {
	SerialNumber string
	Timestamp    time.Time
	Level        string
	Message      string
}

logs-ingester service

type SensorMeasurement

type SensorMeasurement struct {
	SerialNumber string
	Timestamp    time.Time
	Value        float64
}

measurements-ingester service

Jump to

Keyboard shortcuts

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