influxdb

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 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

NewInfluxDBClient creates a new InfluxDB client

func (*InfluxDBClient) Connect

func (c *InfluxDBClient) Connect() error

Connect connects to InfluxDB

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
	CustomerName           string
	SiteName               string
	Gateway                string
	Controller             string
	DeviceType             string
	ControllerSerialNumber string
	DeviceName             string
	DeviceSerialNumber     string
	Data                   map[string]interface{}
	Timestamp              time.Time
}

Jump to

Keyboard shortcuts

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