InfluxCommunity / influxdb3-go

The go package that provides a simple and convenient way to interact with InfluxDB 3.
https://pkg.go.dev/github.com/InfluxCommunity/influxdb3-go
MIT License
21 stars 11 forks source link

bug: Documentation still referring to old influxdb go module naming #40

Closed mfreeman451 closed 9 months ago

mfreeman451 commented 9 months ago

Specifications

"github.com/InfluxCommunity/influxdb3-go/influxdb3" v2.0.0 introduces changes that are not reflected in the current Getting Started documentation on the influx cloud under /new-user-setup/golang

Code sample to reproduce problem

Expected behavior

Influx Cloud should be updated to use the updated names and ClientConfig, ie:

package main

import (
    "github.com/InfluxCommunity/influxdb3-go/influxdb3"
    "os"
)

func main() {
    // Create client
    url := "https://us-east-1-1.aws.cloud2.influxdata.com"
    token := os.Getenv("INFLUXDB_TOKEN")

    // Create a new client using an InfluxDB server base URL and an authentication token
    client, err := influxdb3.New(influxdb3.ClientConfig{
        Host:  url,
        Token: token,
    })

    if err != nil {
        panic(err)
    }
    // Close client at the end and escalate error if present
    defer func(client *influxdb3.Client) {
        err := client.Close()
        if err != nil {
            panic(err)
        }
    }(client)

    database := "events"
        ...
}

Actual behavior

Current code examples do not work with latest golang library for influx-go

Additional info

No response

bednar commented 9 months ago

Hi @mfreeman451,

Thank you for using our client.

The documentation for the go client has been fixed in this pull request: https://github.com/influxdata/ui/pull/6778/files#diff-9de961b300ecd2c456e15a29b2dc12f2d2c6b2860e48f7670c52ef343a6f9a17.

Once the new version of the UI is released, the code documentation will reflect the corrections.

Best regards