influx

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ENV = "IOT_MASTER_INFLUXDB_"

Variables

View Source
var Reader api.QueryAPI
View Source
var Writer api.WriteAPI

Functions

func Close

func Close()

func Insert

func Insert(measurement, id string, fields map[string]interface{}, ts time.Time)

func Load

func Load() error

func Open

func Open()

func SetOptions

func SetOptions(opts Options)

func Store

func Store() error

Types

type Options

type Options struct {
	Url    string `yaml:"url"`
	Org    string `yaml:"org"`
	Bucket string `yaml:"bucket"`
	Token  string `yaml:"token"`
}

func Default

func Default() Options

func GetOptions

func GetOptions() Options

func (*Options) FromEnv

func (options *Options) FromEnv()

func (*Options) ToEnv

func (options *Options) ToEnv() []string

type Point

type Point struct {
	Value interface{} `json:"value"`
	Time  time.Time   `json:"time"`
}

func Query

func Query(measurement, id, field, start, end, win, fn string) ([]Point, error)

func Rate

func Rate(measurement, id, field, start, end, win string) ([]Point, error)

Jump to

Keyboard shortcuts

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