Documentation
¶
Index ¶
- func Client() influxdb2.Client
- func Close()
- func Health() (*domain.HealthCheck, error)
- func Init() (err error)
- func New(cfg config.Influxdb) (influxdb2.Client, error)
- func Query(query string) (*api.QueryTableResult, error)
- func QueryAPI() api.QueryAPI
- func WriteAPI() api.WriteAPIBlocking
- func WritePoint(measurement string, tags map[string]string, fields map[string]any, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.