func (hook *InfluxDBHook) newInfluxDBClient(config *Config) (influxdb.Client, error) {
	protocol := "http"
	if config.UseHTTPS {
		protocol = "https"
	}
	return influxdb.NewHTTPClient(influxdb.HTTPConfig{
		Addr:     fmt.Sprintf("%s://%s:%d", protocol, config.Host, config.Port),
		Username: config.Username,
		Password: config.Password,
		Timeout:  config.Timeout,
	})
}
Returns an influxdb client
package logrus_influxdb
import (
	"fmt"
	influxdb "github.com/influxdata/influxdb1-client/v2"
)