Skip to content

Commit

Permalink
chore: prepare major version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Nov 12, 2024
1 parent 795cb87 commit bc28c61
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 26 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import (
"fmt"
"os"
"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/influxdb3/v1"
)
```

Expand Down
5 changes: 2 additions & 3 deletions examples/Basic/basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import (
"os"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/apache/arrow/go/v15/arrow"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
)

func main() {
Expand Down Expand Up @@ -104,7 +103,7 @@ func main() {
// The keys are the column names, allowing you to access the values by column name.
value := iterator.Value()
fmt.Printf("%s at %v:\n", value["location"],
(value["time"].(arrow.Timestamp)).ToTime(arrow.Nanosecond).Format(time.RFC822))
(value["time"].(time.Time)).Format(time.RFC822))
fmt.Printf(" temperature: %f\n", value["temperature"])
fmt.Printf(" humidity : %d%%\n", value["humidity"])
}
Expand Down
7 changes: 3 additions & 4 deletions examples/Batching/batching.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import (
"text/tabwriter"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/influxdb3/batching"
"github.com/apache/arrow/go/v15/arrow"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching"
)

const NumPoints = 54
Expand Down Expand Up @@ -142,7 +141,7 @@ func main() {
// Process the data
for iterator.Next() {
value := iterator.Value()
t := (value["time"].(arrow.Timestamp)).ToTime(arrow.Nanosecond).Format(time.RFC3339)
t := (value["time"].(time.Time)).Format(time.RFC3339)
fmt.Fprintf(w, "%v\t%s\t%.1f\t%d\n", t, value["location"], value["temperature"], value["humidity"])
}
}
10 changes: 5 additions & 5 deletions examples/Downsampling/downsampling.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package main
import (
"context"
"fmt"
"github.com/apache/arrow/go/v15/arrow"
"os"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/apache/arrow/go/v15/arrow"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
)

func main() {
Expand Down Expand Up @@ -96,10 +96,10 @@ func main() {
for iterator.Next() {
row := iterator.AsPoints()
timestamp := (row.GetField("window_start").(arrow.Timestamp)).ToTime(arrow.Nanosecond)
location := row.GetStringField("location")
location, _ := row.GetTag("location")
avgValue := row.GetDoubleField("avg")
maxValue := row.GetDoubleField("max")
fmt.Printf("%s %s temperature: avg %.2f, max %.2f\n", timestamp.Format(time.RFC822), *location, *avgValue, *maxValue)
fmt.Printf("%s %s temperature: avg %.2f, max %.2f\n", timestamp.Format(time.RFC822), location, *avgValue, *maxValue)

//
// Write back downsampled data.
Expand All @@ -114,7 +114,7 @@ func main() {
downsampledPoint = downsampledPoint.
RemoveField("window_start").
SetTimestampWithEpoch(timestamp.UnixNano())

// Write the downsampled Point to the database.
err = client.WritePoints(context.Background(), []*influxdb3.Point{downsampledPoint})
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/HTTPErrorHandled/httpErrorHandled.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"log"
"os"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
)

// Demonstrates working with HTTP response headers in ServerError
Expand Down
7 changes: 3 additions & 4 deletions examples/LPBatching/lpBatching.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import (
"text/tabwriter"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/influxdb3/batching"
"github.com/apache/arrow/go/v15/arrow"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching"
)

const LineCount = 100
Expand Down Expand Up @@ -133,7 +132,7 @@ func main() {
fmt.Fprintln(tw, "\nTime\tid\tlocation\tspeed\tbearing\tticks")
for iterator.Next() {
value := iterator.Value()
t := (value["time"].(arrow.Timestamp)).ToTime(arrow.Nanosecond).Format(time.RFC3339)
t := (value["time"].(time.Time)).Format(time.RFC3339)
_, err := fmt.Fprintf(tw, "%v\t%s\t%s\t%.1f\t%.2f\t%d\n", t,
value["id"], value["location"], value["speed"], value["bearing"], value["ticks"])
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/InfluxCommunity/influxdb3-go
module github.com/InfluxCommunity/influxdb3-go/v1

go 1.22.7

Expand Down
2 changes: 1 addition & 1 deletion influxdb3/batching/batcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"log/slog"
"sync"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
)

// DefaultBatchSize is the default number of points emitted
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/batching/batcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"testing"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
"github.com/stretchr/testify/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions influxdb3/batching/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
"math/rand"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/influxdb3/batching"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching"
)

func Example_batcher() {
Expand Down
4 changes: 2 additions & 2 deletions influxdb3/client_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import (
"testing"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/influxdb3/batching"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/batching"
"github.com/influxdata/line-protocol/v2/lineprotocol"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion influxdb3/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"strings"
"time"

"github.com/InfluxCommunity/influxdb3-go/influxdb3/gzip"
"github.com/InfluxCommunity/influxdb3-go/v1/influxdb3/gzip"
"github.com/influxdata/line-protocol/v2/lineprotocol"
)

Expand Down

0 comments on commit bc28c61

Please sign in to comment.