models

package
v0.0.0-...-610bbfe Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	gorm.Model
	DeviceID              string `gorm:"unique"`
	Latitude              float64
	Longitude             float64
	Value                 string
	DeviceModelID         uint
	DeviceModel           DeviceModel
	DateLastValueReported time.Time
	DeviceState           string
}

Device is the database model to store devices in our database

type DeviceControlledProperty

type DeviceControlledProperty struct {
	gorm.Model
	Name         string `gorm:"unique"`
	Abbreviation string
}

DeviceControlledProperty stores different properties that devices can control/sense/meter/whatever

type DeviceModel

type DeviceModel struct {
	gorm.Model
	DeviceModelID        string `gorm:"unique"`
	BrandName            string
	ModelName            string
	ManufacturerName     string
	Name                 string
	Category             string
	ControlledProperties []DeviceControlledProperty `gorm:"many2many:devicemodel_ctrlprops;"`
}

DeviceModel is the database model to store Fiware Device Models in our database

type DeviceValue

type DeviceValue struct {
	gorm.Model
	DeviceID                   uint `gorm:"index:values_from_device"`
	DeviceControlledPropertyID uint `gorm:"index:values_from_property"`
	Value                      string
	ObservedAt                 time.Time
}

DeviceValue stores the value from a point in time (observedAt)

Jump to

Keyboard shortcuts

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