package influxdb import ( iclient "github.com/influxdata/influxdb/client/v2" ) var InfluxCli iclient.Client func Setup(addr, username, password string) error { cli, err := iclient.NewHTTPClient(iclient.HTTPConfig{ Addr: addr, Username: username, Password: password, }) if err != nil { return err } InfluxCli = cli return nil }