model

package
v0.0.0-...-0dca507 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewProjectID

func NewProjectID() string

NewProjectID generates a random string as a project identification.

Types

type Data

type Data struct {
	Raw       []byte      `json:"raw" bson:"raw"`             // data before decode
	Data      interface{} `json:"data" bson:"data"`           // data after decode
	Timestamp time.Time   `json:"timestamp" bson:"timestamp"` // when data received in uplink
	ThingID   string      `json:"thing_id" bson:"thingid"`    // deveui

	RxInfo interface{} `json:"rx_info" bson:"rxinfo"`
	TxInfo interface{} `json:"tx_info" bson:"txinfo"`

	Project  string `json:"project" bson:"project"`   // thing project identification
	Protocol string `json:"protocol" bson:"protocol"` // uplink protocol
	Model    string `json:"model" bson:"model"`       // way of decode
}

Data represents nodes data after parse phase that is done by protocols. Each data have its raw and decoded payload and may have link quality information. This structure is created and remains in the platform for each incoming data.

type Project

type Project struct {
	ID     string        `json:"id" bson:"id"`         // Project unique identifier
	Name   string        `json:"name" bson:"name"`     // project human readable name
	Runner runner.Runner `json:"runner" bson:"runner"` // information about project docker

	Description string `json:"description" bson:"description"` // project description

	Perimeter struct {
		Type string `json:"type" bson:"type"` // GeoJSON type eg. "Polygon"
		// coordinates eg. [ [ [ 0 , 0 ] , [ 3 , 6 ] , [ 6 , 1 ] , [ 0 , 0  ] ] ]
		Coordinates [][][]float64 `json:"coordinates" bson:"coordinates"`
	} `json:"perimeter" bson:"perimeter"`
}

Project represents structure of I1820 platform projects The project is a virtual entity that collects things together under one name and eases their management, like an Agricultural project that manages your farm and its smart things.

type ProjectLog

type ProjectLog struct {
	Time    time.Time `bson:"Time"`
	Message string    `bson:"Message"`
	Code    string    `bson:"code"`
	Job     string    `bson:"job"`
	Level   int       `bson:"Level"`
}

ProjectLog represents project logs that are collected from their dockers.

type Thing

type Thing struct {
	Name    string `json:"name" bson:"name"`       // DevEUI
	Status  bool   `json:"status" bson:"status"`   // active/inactive
	Model   string `json:"model" bson:"model"`     // model describes project decoder
	Project string `json:"project" bson:"project"` // project identification
}

Thing contains thing identification and its parent project.

Jump to

Keyboard shortcuts

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