Documentation
¶
Index ¶
- Constants
- func GetTestBuffer(con *InfluxDBConnection) (string, error)
- type InfluxConfig
- type InfluxDBConnection
- func (conn *InfluxDBConnection) Close()
- func (conn *InfluxDBConnection) Query(query string) ([]Row, error)
- func (conn *InfluxDBConnection) RecordBatchPoints(points []Point) error
- func (conn *InfluxDBConnection) RecordPoint(p Point) error
- func (conn *InfluxDBConnection) WritePoint(measurement string, tags map[string]string, fields map[string]interface{}) error
- type Point
- type Row
Constants ¶
const ( HTTP = "HTTP" UDP = "UDP" )
Connection type.
Variables ¶
This section is empty.
Functions ¶
func GetTestBuffer ¶
func GetTestBuffer(con *InfluxDBConnection) (string, error)
GetTestBuffer returns the string that would normally be written to influx DB
Types ¶
type InfluxConfig ¶
type InfluxConfig struct { Hostname string Port uint16 Protocol string Database string RetentionPolicy string }
InfluxConfig is a configuration struct for influxlib.
type InfluxDBConnection ¶
type InfluxDBConnection struct { Client influxdb.Client Config *InfluxConfig }
InfluxDBConnection is an object that the wrapper uses. Holds a client of the type v2.Client and the configuration
func Connect ¶
func Connect(config *InfluxConfig) (*InfluxDBConnection, error)
Connect takes an InfluxConfig and establishes a connection to InfluxDB. It returns an InfluxDBConnection structure. InfluxConfig may be nil for a default connection.
func NewMockConnection ¶
func NewMockConnection() (*InfluxDBConnection, error)
NewMockConnection returns an influxDBConnection with a "fake" client for offline testing.
func (*InfluxDBConnection) Close ¶
func (conn *InfluxDBConnection) Close()
Close closes the connection opened by Connect()
func (*InfluxDBConnection) Query ¶
func (conn *InfluxDBConnection) Query(query string) ([]Row, error)
Query sends a query to the influxCli and returns a slice of rows. Rows are of type map[string]interface{}
func (*InfluxDBConnection) RecordBatchPoints ¶
func (conn *InfluxDBConnection) RecordBatchPoints(points []Point) error
RecordBatchPoints takes in a slice of influxlib.Point and writes them to the database.
func (*InfluxDBConnection) RecordPoint ¶
func (conn *InfluxDBConnection) RecordPoint(p Point) error
RecordPoint implements the same as WritePoint but used a point struct as the argument instead.
func (*InfluxDBConnection) WritePoint ¶
func (conn *InfluxDBConnection) WritePoint(measurement string, tags map[string]string, fields map[string]interface{}) error
WritePoint stores a datapoint to the database. Measurement:
The measurement to write to
Tags:
A dictionary of tags in the form string=string
Fields:
A dictionary of fields(keys) with their associated values
type Point ¶
type Point struct { Measurement string Tags map[string]string Fields map[string]interface{} Timestamp time.Time }
Point represents a datapoint to be written. Measurement:
The measurement to write to
Tags:
A dictionary of tags in the form string=string
Fields:
A dictionary of fields(keys) with their associated values