adapter

package
v0.0.0-...-c42e73f Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppToKafka

func AppToKafka(kd *KafkaData) model.KafkaData

func AppToNode

func AppToNode(an *Node) model.Node

func AppToSensor

func AppToSensor(as *Sensor) model.Sensor

Types

type KafkaData

type KafkaData struct {
	Key   string     `json:"key"`
	Value SensorData `json:"value"`
}

type MetaInfo

type MetaInfo struct {
	NInfo []Node   `json:"node_info"`
	SInfo []Sensor `json:"sensor_info"`
}

type Node

type Node struct {
	UUID     string `json:"uuid"`
	Name     string `json:"name"`
	Group    string `json:"group"`
	Location struct {
		Lat float64 `json:"lat"`
		Lon float64 `json:"lon"`
	} `json:"location"`
}

type Sensor

type Sensor struct {
	UUID      string        `json:"uuid"`
	Name      string        `json:"name"`
	ValueList []SensorValue `json:"value_list"`
}

type SensorData

type SensorData struct {
	NID       string    `json:"nid"`
	Values    []float64 `json:"values"`
	Timestamp string    `json:"timestamp"`
}

type SensorValue

type SensorValue struct {
	SensorUUID string `json:"sensor_uuid"`
	ValueName  string `json:"value_name"`
	Index      int    `json:"index"`
}

Jump to

Keyboard shortcuts

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