[Go] go连接influxdb的库
开启了influxdb后,会监听8086端口
下载客户端代码
git clone https://github.com/influxdata/influxdb1-client.git $GOPATH/src/github.com/influxdata/influxdb1-client
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) } }
十年开发经验程序员,离职全心创业中,历时三年开发出的产品《唯一客服系统》
一款基于Golang+Vue开发的在线客服系统,软件著作权编号:2021SR1462600。一套可私有化部署的网站在线客服系统,编译后的二进制文件可直接使用无需搭开发环境,下载zip解压即可,仅依赖MySQL数据库,是一个开箱即用的全渠道在线客服系统,致力于帮助广大开发者/公司快速部署整合私有化客服功能。
开源地址:唯一客服(开源学习版)
官网地址:唯一客服官网