tsdb

package
v0.0.0-...-91c7ab2 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildFluxQLQueryFilter

func BuildFluxQLQueryFilter(tagNames, tagValues, fields []string) string

BuildFluxQLQueryFilter you'd best set single tag to avoid table changed, or fields mismatch with certain struct for following query cmd

func NewBuildFluxQLQueryFilter

func NewBuildFluxQLQueryFilter(tags map[string]string, fields map[string]interface{}) string

Types

type InfluxdbClient

type InfluxdbClient struct {
	// contains filtered or unexported fields
}

func GetInfluxdbClient

func GetInfluxdbClient() *InfluxdbClient

func InitInfluxDB

func InitInfluxDB(addr, username, password, org, bucket string) (*InfluxdbClient, error)

func (*InfluxdbClient) AddPoint

func (c *InfluxdbClient) AddPoint(measurement string, tags map[string]string, fields map[string]interface{}) error

func (*InfluxdbClient) AddRecord

func (c *InfluxdbClient) AddRecord(measurement string, tagName, tagValues []string, fields []interface{}) error

func (*InfluxdbClient) Close

func (c *InfluxdbClient) Close()

func (*InfluxdbClient) CountRecordWithFluxQL

func (c *InfluxdbClient) CountRecordWithFluxQL(measurement, filter string, start, end time.Time) int64

func (*InfluxdbClient) DeletePoint

func (c *InfluxdbClient) DeletePoint(measurement string, tagKeys, tagValues []string, start, end time.Time) error

func (*InfluxdbClient) QueryWithFluxQL

func (c *InfluxdbClient) QueryWithFluxQL(measurement, filter string, start, end time.Time) (*api.QueryTableResult, error)

func (*InfluxdbClient) UnsupportedQueryPointWithSQL

func (c *InfluxdbClient) UnsupportedQueryPointWithSQL() error

type SIMG

type SIMG struct {
	Timestamp time.Time `json:"Timestamp"` //Timestamp hard code in BuildFluxQLQueryFilter()
	Press     float64   `json:"Press"`
	Density   float64   `json:"Density"`
	Temp      float64   `json:"Temp"`
}

type SensorSIMG

type SensorSIMG []SIMG

func (SensorSIMG) ParseSensorData

func (s SensorSIMG) ParseSensorData(result *api.QueryTableResult) ([]SIMG, error)

Jump to

Keyboard shortcuts

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