influx

package
v0.0.0-...-c393e39 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: ISC Imports: 14 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) error

func EncodePoints

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

Types

type Client

type Client struct {
	Cfg        ClientCfg
	Log        *log.Logger
	HTTPClient *http.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) SendPoints

func (c *Client) SendPoints(points Points) error

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        *log.Logger  `json:"-"`
	HTTPClient *http.Client `json:"-"`
	Hostname   string       `json:"-"`

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

func (*ClientCfg) ValidateJSON

func (cfg *ClientCfg) ValidateJSON(v *ejson.Validator)

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