influxdb

package module
v0.0.0-...-7170b3a Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2017 License: MIT Imports: 9 Imported by: 0

README

influxdb

DEPRECATED: We recommend using the official client at https://github.com/influxdata/influxdb/tree/master/client instead.

Unofficial InfluxDB client written in Go to send stats and query the stored data.

This client library has additional goodies that the official one does not have (like interacting with golang.org/x/net/context) but it is incomplete; it only contains the functions we need for our applications.

Install

go get github.com/altipla-consulting/influxdb

Documentation

GoDoc

Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using gofmt.

License

MIT License

Documentation

Overview

Package influxdb allows to send data to a remote InfluxDB server and then query the data to obtain results. It has several improvements over the standard Go client (like interacting with golang.org/x/net/context) but it is incomplete. It only contains functions and calls we need in our applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithContext

func WithContext(ctx context.Context, host, database, username, password string) context.Context

WithContext opens a new connection to a remote database and adds it to the context

func Write

func Write(ctx context.Context, series []*WriteSerie) error

Write sends a list of points of several series to the server.

func WriteOne

func WriteOne(ctx context.Context, serie *WriteSerie) error

WriteOne sends a list of points of a single serie to the server.

Types

type Connection

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

Connection to a remote InfluxDB server.

func FromContext

func FromContext(ctx context.Context) *Connection

FromContext returns the database stored in the context

func NewConnection

func NewConnection(host, database, username, password string) *Connection

NewConnection creates a new connection to a remote server.

type QueryResult

type QueryResult struct {
	Name   string
	Points []map[string]interface{}
}

QueryResult contains the rows returned by the server in a query.

func Query

func Query(ctx context.Context, query string) (*QueryResult, error)

Query sends a new query to the server and returns the result

type WriteSerie

type WriteSerie struct {
	Name   string
	Points []map[string]interface{}
}

WriteSerie contains the list of points of a single serie to send to the server.

Jump to

Keyboard shortcuts

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