datapipe

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// NATURE
	Sensor   = "SEN"
	Factor   = "FACT"
	Actuator = "ACT"
	Target   = "TAR"
	It       = "IT"

	// GROUP
	Temperature = "TMP"
	ValveOpen   = "VALVE_OPEN"
	State       = "C_STATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

type Conf struct {
	DatapipeURL           string
	DatapipeCertPath      string
	DatapipeKeyPath       string
	DatapipeTokenEndPoint string
	LogLevel              string
}

Conf represents the configuration settings required to connect to a Datapipe service. It includes the following fields: - DatapipeURL: The URL of the Datapipe service. - DatapipeCertPath: The file path to the Datapipe client certificate. - DatapipeKeyPath: The file path to the Datapipe client key. - DatapipeCAPath: The file path to the Datapipe Certificate Authority (CA) certificate. - DatapipeTokenEndPoint: The endpoint for obtaining a token for the Datapipe service.

type Data

type Data struct {
	Date   int64  `json:"date"`
	Fields Fields `json:"fields,omitempty"`
}

type Datapipe

type Datapipe struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Datapipe) Init

func (d *Datapipe) Init(conf Conf)

Init datapipe

func (*Datapipe) WriteData

func (d *Datapipe) WriteData(nature, entityID, projectID, factor, zoneID, itemID string, ts int64, value interface{}, reliability int)

type Fields

type Fields struct {
	RELIABILITY int      `json:"RELIABILITY,omitempty"`
	VALUENB     *float64 `json:"VALUENB,omitempty"`
	VALUESTR    string   `json:"VALUESTR,omitempty"`
}

type Info

type Info struct {
	Nature       string `json:"Nature"`
	Zone         string `json:"Zone,omitempty"`
	Group        string `json:"Group"`
	DataSourceID string `json:"dataSourceId,omitempty"`
	BuildingID   string `json:"BuildingId"`
	ProjectID    string `json:"ProjectId"`
}

type WriteMessage

type WriteMessage struct {
	Info Info   `json:"info"`
	Data []Data `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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