influx

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PluginInfluxdbV2 = "influxdb"

	MeasurementBinary       = "binary_data"
	MeasurementGaugeInteger = "gauge_int_data"
	MeasurementGaugeFloat   = "gauge_float_data"
	MeasurementCounter      = "counter_data"
	MeasurementString       = "string_data"
	MeasurementGeo          = "geo_data"

	QueryClientV1 = "v1"
	QueryClientV2 = "v2"

	DefaultMeasurementPrefix = "mc"
)

global constants

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, config cmap.CustomMap) (metricTY.Plugin, error)

client of influxdb

Types

type Client

type Client struct {
	Client influxdb2.Client

	Config Config
	// contains filtered or unexported fields
}

Client of the influxdb

func (*Client) Close

func (c *Client) Close() error

Close the influxdb connection

func (*Client) Name

func (c *Client) Name() string

func (*Client) Ping

func (c *Client) Ping() error

Ping to target database

func (*Client) Query

func (c *Client) Query(queryConfig *metricTY.QueryConfig) (map[string][]metricTY.ResponseData, error)

Query func implementation

func (*Client) Write

func (c *Client) Write(data *metricTY.InputData) error

func (*Client) WriteBlocking

func (c *Client) WriteBlocking(data *metricTY.InputData) error

WriteBlocking implementation

type Config

type Config struct {
	IsCloudInstance    bool   `yaml:"is_cloud_instance"`
	OrganizationName   string `yaml:"organization_name"`
	BucketName         string `yaml:"bucket_name"`
	MeasurementPrefix  string `yaml:"measurement_prefix"`
	URI                string `yaml:"uri"`
	Token              string `yaml:"token"`
	Username           string `yaml:"username"`
	Password           string `yaml:"password"`
	Insecure           bool   `yaml:"insecure"`
	QueryClientVersion string `yaml:"query_client_version"`
	FlushInterval      string `yaml:"flush_interval"`
}

Config of the influxdb_v2

type LoggerConfig

type LoggerConfig struct {
	Mode             string `yaml:"mode"`
	Encoding         string `yaml:"encoding"`
	Level            string `yaml:"level"`
	EnableStacktrace bool   `yaml:"enable_stacktrace"`
}

LoggerConfig struct

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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