influxdb

package
v0.10.14 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() influxdb2.Client

Client returns the global InfluxDB client

func Close

func Close()

Close gracefully shuts down the InfluxDB client

func Health

func Health() (*domain.HealthCheck, error)

Health checks the current health of the InfluxDB server

func Init

func Init() (err error)

Init initializes the global InfluxDB client. It reads InfluxDB configuration from config.App.Influxdb. If InfluxDB is not enabled, it returns nil. The function is thread-safe and ensures the client is initialized only once.

func New

func New(cfg config.Influxdb) (influxdb2.Client, error)

New returns a new InfluxDB client instance with given configuration. It's the caller's responsibility to close the client, caller should always call client.Close() when it's no longer needed.

func Query

func Query(query string) (*api.QueryTableResult, error)

Query executes a Flux query against InfluxDB

func QueryAPI

func QueryAPI() api.QueryAPI

QueryAPI returns the global InfluxDB query API

func WriteAPI

func WriteAPI() api.WriteAPIBlocking

WriteAPI returns the global InfluxDB write API

func WritePoint

func WritePoint(measurement string, tags map[string]string, fields map[string]any, ts ...time.Time) error

WritePoint writes a single point to InfluxDB

Types

This section is empty.

Jump to

Keyboard shortcuts

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