influx

package
v0.0.0-...-800adf3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: ISC Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodePoint

func EncodePoint(p *Point, buf *bytes.Buffer)

func EncodePoints

func EncodePoints(ps Points, buf *bytes.Buffer)

func HTTPClientCfg

func HTTPClientCfg(cfg *ClientCfg) dhttp.ClientCfg

Types

type Client

type Client struct {
	Cfg        ClientCfg
	Log        *dlog.Logger
	HTTPClient *dhttp.Client
	// contains filtered or unexported fields
}

func NewClient

func NewClient(cfg ClientCfg) (*Client, error)

func (*Client) EnqueuePoint

func (c *Client) EnqueuePoint(p *Point)

func (*Client) EnqueuePoints

func (c *Client) EnqueuePoints(points Points)

func (*Client) Start

func (c *Client) Start()

func (*Client) Stop

func (c *Client) Stop()

func (*Client) Terminate

func (c *Client) Terminate()

type ClientCfg

type ClientCfg struct {
	Log        *dlog.Logger  `json:"-"`
	HTTPClient *dhttp.Client `json:"-"`
	Hostname   string        `json:"-"`

	URI         string            `json:"uri"`
	Bucket      string            `json:"bucket"`
	Org         string            `json:"org"`
	BatchSize   int               `json:"batch_size"`
	Tags        map[string]string `json:"tags"`
	LogRequests bool              `json:"log_requests"`
}

func (*ClientCfg) Check

func (cfg *ClientCfg) Check(c *check.Checker)

type Fields

type Fields map[string]interface{}

type Point

type Point struct {
	Measurement string
	Tags        Tags
	Fields      Fields
	Timestamp   *time.Time
}

func NewPoint

func NewPoint(measurement string, tags Tags, fields Fields) *Point

func NewPointWithTimestamp

func NewPointWithTimestamp(measurement string, tags Tags, fields Fields, t time.Time) *Point

type Points

type Points []*Point

type Tags

type Tags map[string]string

Jump to

Keyboard shortcuts

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