[Go] go连接influxdb的库
发布时间:2021-05-21 06:47:07 所属栏目:大数据 来源: https://www.jb51.cc
导读:开启了influxdb后,会监听8086端口 下载客户端代码 git clone https://github.com/influxdata/influxdb1-client.git $GOPATH/src/github.com/influxdata/influxdb1-client package mainimport ( " fmt " _ github.com/influxdata/influxdb1-client " // this
开启了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: SELECT *FROM webmail_log",sinamail"") if response,err := c.Query(q); err == nil && response.Error() ==fmt.Println(response.Results) } } ? (编辑:北几岛) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |