velodrome/token-counter/influx.go
func (config *InfluxConfig) CreateDatabaseClient() (*InfluxDB, error) {
	client, err := influxdb.NewHTTPClient(influxdb.HTTPConfig{
		Addr:     config.Host,
		Username: config.User,
		Password: config.Password,
	})
	if err != nil {
		return nil, err
	}

	return &InfluxDB{
		client:   client,
		database: config.DB,
	}, nil
}
func (config *InfluxConfig) CreateDatabaseClient() (*InfluxDB, error) {
	client, err := influxdb.NewHTTPClient(influxdb.HTTPConfig{
		Addr:     config.Host,
		Username: config.User,
		Password: config.Password,
	})
	if err != nil {
		return nil, err
	}

	return &InfluxDB{
		client:   client,
		database: config.DB,
	}, nil
}
// CreateDatabaseClient creates and connects a new instance of an InfluxDB
// It is created based on the fields set in the configuration.