influxdb

package
v0.1.36 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package influxdb provides an InfluxDB endpoint for metrics data.

InfluxDB is a time-series database:

https://www.influxdata.com/time-series-platform/influxdb/

Index

Constants

View Source
const (
	DefaultHost    = "localhost"
	DefaultPort    = 8086
	DefaultTimeout = time.Minute
)

The default options values.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides an InfluxDB client connection.

func New

func New(database string, optional ...Option) (*Client, error)

New returns a connection to InfluxDB.

func (*Client) Close

func (c *Client) Close() error

Close prevent further points being submitted.

func (*Client) Submit

func (c *Client) Submit(_ context.Context, p *metrics.Point) error

Submit submits the given point.

func (*Client) SubmitPoints

func (c *Client) SubmitPoints(_ context.Context, itr metrics.PointIterator) error

SubmitPoints submits the points in the given iterator.

func (*Client) SubmitSlice

func (c *Client) SubmitSlice(_ context.Context, ps []*metrics.Point) error

SubmitSlice submits the slice of points.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option sets options on an InfluxDB client connection.

func Host

func Host(host string) Option

Host sets the hostname of the InfluxDB server.

func Password

func Password(password string) Option

Password sets the password to use when connecting with the InfluxDB server.

func Port

func Port(port int) Option

Port sets the port of the InfluxDB server.

func Timeout

func Timeout(d time.Duration) Option

Timeout sets the timeout when attempting to communication with the InfluxDB server. A value of 0 means that there is no timeout.

func UserAgent

func UserAgent(useragent string) Option

UserAgent sets the user agent to use when connecting with the InfluxDB server.

func Username

func Username(username string) Option

Username sets the username to use when connecting with the InfluxDB server.

Jump to

Keyboard shortcuts

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