models

package
v0.0.0-...-9bd6792 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisMemorySensorData

type AnalysisMemorySensorData struct {
	Average   float64 `json:"average"`
	Deviation float64 `json:"deviation"`
	Mean      float64 `json:"mean"`
	Min       float64 `json:"min"`
	Max       float64 `json:"max"`
}

type AnalysisPayload

type AnalysisPayload struct {
	VirtualSensorData AnalysisVirtualSensorData `json:"virtual_sensor_data"`
	MemorySensorData  AnalysisMemorySensorData  `json:"memory_sensor_data"`
}

type AnalysisVirtualSensorData

type AnalysisVirtualSensorData struct {
	Average   float64 `json:"average"`
	Deviation float64 `json:"deviation"`
	Mean      float64 `json:"mean"`
	Min       float64 `json:"min"`
	Max       float64 `json:"max"`
}

type BaseEnv

type BaseEnv struct {
	SocketAddr string
}

type Message

type Message struct {
	Topic   MessageTopic            `json:"topic"`
	Payload *map[string]interface{} `json:"payload"`
	Time    time.Time               `json:"time"`
}

func NewMessage

func NewMessage(topic MessageTopic, payload any) Message

creates a new message with the given topic and payload

type MessageTopic

type MessageTopic string
const (
	All       MessageTopic = "all"
	Heartbeat MessageTopic = "heartbeat"
	Sensor    MessageTopic = "sensor"
	Fog       MessageTopic = "edge"
	Cloud     MessageTopic = "cloud"
	Analysis  MessageTopic = "Analysis"
)

type SensorMessage

type SensorMessage struct {
	// timestamp of the message
	Timestamp int64 `json:"timestamp"`

	// message content
	Content string `json:"content"`
}

func NewSensorMessage

func NewSensorMessage(content string) SensorMessage

creates a new sensor message with the given content

Jump to

Keyboard shortcuts

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