influxdb

package
v0.0.0-...-9b940c6 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BATCH_SIZE     = 3
	FLUSH_INTERVAL = 10000
	RETRY_INTERVAL = 5000
	MAX_RETRIES    = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type InfluxDBClient

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

func NewInfluxDBClient

func NewInfluxDBClient(url, token, org, bucket string) *InfluxDBClient

func (*InfluxDBClient) Connect

func (c *InfluxDBClient) Connect() error

func (*InfluxDBClient) Connected

func (c *InfluxDBClient) Connected() bool

Connected checks if the client is connected

func (*InfluxDBClient) Disconnect

func (c *InfluxDBClient) Disconnect()

Disconnect closes the connection to InfluxDB

func (*InfluxDBClient) WriteData

func (h *InfluxDBClient) WriteData(data Message) error

WriteData writes data to InfluxDB

type InfluxDBConfig

type InfluxDBConfig struct {
	URL    string
	Token  string
	Org    string
	Bucket string
}

type Message

type Message struct {
	State        string
	Worker       string
	Customer     string
	DeviceType   string
	SerialNumber string
	SiteName     string
	Timestamp    time.Time
	Data         map[string]interface{}
}

Jump to

Keyboard shortcuts

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