在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开启了influxdb后,会监听8086端口 package main import ( "fmt" _ "github.com/influxdata/influxdb1-client" // this is important because of the bug in go mod client "github.com/influxdata/influxdb1-client/v2" ) func main() { c, err := client.NewHTTPClient(client.HTTPConfig{ Addr: "http://172.17.0.3:8086", }) if err != nil { fmt.Println("Error creating InfluxDB Client: ", err.Error()) } defer c.Close() q := client.NewQuery("SELECT *FROM webmail_log", "sinamail", "") if response, err := c.Query(q); err == nil && response.Error() == nil { fmt.Println(response.Results) } }
|
请发表评论