konimarti / opc

OPC DA client in Golang for monitoring and analyzing process data based on Windows COM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Influxdb Authentication

Gearbox007 opened this issue · comments

Hello, this is my first time doing this so bear with me.

Following your guide, I'm trying to write to a test database, except I have authentication enabled on influxdb. I get this error:

Writing to test a http://192.168.x.x:8086
<"error":"unable to parse authentication credentials">

So I looked into the main.go file in the opcflux folder, and found

//setup influxdb client
//TODO: get username and password for influx from environment variables
c, err := client.NewHTTPClient(client.HTTPConfig{
Addr: conf.Influx.Addr,
//Username: conf.Influx.Username,
//Password: conf.Influx.Password,

Other than disabling auth on the database, how can I go about hard coding the username and password into go, at least until this part of the project gets finished.

Thank you for your response, I hard coded it. It works great!