influxdb_client

package
v0.0.0-...-693abe4 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOption

type ClientOption func(client *InfluxdbClient)

func WithAddr

func WithAddr(addr string) ClientOption

func WithBlockOnError

func WithBlockOnError() ClientOption

func WithMaxCachePoint

func WithMaxCachePoint(max int) ClientOption

func WithTimeout

func WithTimeout(timeout time.Duration) ClientOption

type FieldKey

type FieldKey struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

FieldKey represents a result's structure from influxdb with query `SHOW FIELD KEYS FROM ...`

type InfluxdbClient

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

InfluxdbClient station

func NewInfluxdbClient

func NewInfluxdbClient(ctx context.Context, options ...ClientOption) (*InfluxdbClient, error)

New InfluxDB component

func (*InfluxdbClient) Databases

func (client *InfluxdbClient) Databases() ([]string, error)

Databases return the database list on influxdb

func (*InfluxdbClient) Fields

func (client *InfluxdbClient) Fields(database string, measurements []string) (map[string][]FieldKey, error)

Fields get all tag keys from influxdb in given measurements

func (*InfluxdbClient) Measurements

func (client *InfluxdbClient) Measurements(database string) ([]string, error)

Measurements return the measurement list on a specify database

func (*InfluxdbClient) Query

func (client *InfluxdbClient) Query(sql, database, precision string) ([]influxmodels.Row, error)

Query execute the given sql query on influxdb

func (*InfluxdbClient) Request

func (client *InfluxdbClient) Request(sql, database, precision string) (*influxdb.Response, error)

Request execute a query on influxdb, and return the raw response

func (*InfluxdbClient) Tags

func (client *InfluxdbClient) Tags(database string, measurements []string) (map[string][]string, error)

Tags get all tag keys from influxdb for group-artifact

func (*InfluxdbClient) WaitExit

func (client *InfluxdbClient) WaitExit()

WaitExit block until all the processer exit

func (*InfluxdbClient) Write

func (client *InfluxdbClient) Write(database, rp string, points []*influxdb.Point) error

Write influxdb point data

Jump to

Keyboard shortcuts

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