influxdb

package
v0.0.0-...-13dad8c Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Settings *influxDBSettings

Settings holds all pertient connection parameters for InfluxDB

Functions

func ExecuteQuery

func ExecuteQuery(c *clientv1.Client, query string) (*clientv1.Response, error)

ExecuteQuery executes the given query against the database and returns the response or an error

func LoadConfig

func LoadConfig()

LoadConfig (re)loads the influxDB config so a connection can be initialized

func NewClientWithTimeout

func NewClientWithTimeout(timeout time.Duration) (*clientv1.Client, error)

NewClientWithTimeout will retry pinging the server until a specified timeout passes

func NewHTTPClient

func NewHTTPClient() (client.Client, error)

NewHTTPClient creates a new client for reading & writing data to influxDB over HTTP

func Query

func Query(query string) (*client.Response, error)

Query executes InfluxQL statements against the configured database

func QueryAverageTemperature

func QueryAverageTemperature(period time.Duration, probe int32) (*models.TemperatureReading, error)

QueryAverageTemperature retrieves the average temperature over the given period for the requested probe from InfluxDB

func WritePoint

func WritePoint(name string, tags map[string]string, fields map[string]interface{}) (*client.Point, error)

WritePoint writes a single point to the DB with the given name, tags and fields

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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