package data

import (
	"git.quantgroup.cn/DevOps/enoch/service/conf"
	"git.quantgroup.cn/DevOps/enoch/service/log"
	"github.com/influxdata/influxdb/client/v2"
)

func NewClient() client.Client {
	var httpConfig = client.HTTPConfig{
		Addr: conf.GlobalConfig.InfluxDb.Host + ":" + conf.GlobalConfig.InfluxDb.Port,
	}
	con, err := client.NewHTTPClient(httpConfig)

	if err != nil {
		logger.Error.Println(err.Error())
	}

	return con

}
