Skip to content

Commit ca2cdaf

Browse files
committed
Go 1.21.1, log/slog, dependencies
1 parent 27c8bc4 commit ca2cdaf

File tree

10 files changed

+104
-46
lines changed

10 files changed

+104
-46
lines changed

.drone.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ steps:
2121
memory: 100MiB
2222

2323
- name: test
24-
image: golang:1.20.5
24+
image: golang:1.21.1
2525
volumes:
2626
- name: go
2727
path: /go
@@ -32,7 +32,7 @@ steps:
3232
- go build ./...
3333

3434
- name: goreleaser
35-
image: golang:1.20.5
35+
image: golang:1.21.1
3636
resources:
3737
requests:
3838
cpu: 6000
@@ -49,9 +49,7 @@ steps:
4949
# GITHUB_TOKEN:
5050
# from_secret: GITHUB_TOKEN
5151
commands:
52-
- go install github.com/goreleaser/[email protected]
5352
- ./scripts/run-goreleaser
54-
- echo Done
5553
depends_on: [test]
5654

5755
- name: docker
@@ -83,6 +81,6 @@ volumes:
8381

8482
---
8583
kind: signature
86-
hmac: bfa8b3a2eec541120917b6335ec4319650e41d0f2bc9701897bffaa38cadd2a4
84+
hmac: 05204fffeb72719d541b368c2950e2830ceeb0a344e10b0db526ddd4eeb695f0
8785

8886
...

chdb/db.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import (
44
"context"
55
"time"
66

7+
"log/slog"
8+
79
"github.com/ClickHouse/clickhouse-go/v2"
810
"github.com/ClickHouse/clickhouse-go/v2/lib/driver"
11+
912
"go.ntppool.org/common/version"
10-
"golang.org/x/exp/slog"
1113
)
1214

1315
type ClickHouse struct {

chdb/geoqueries.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import (
66
"context"
77
"fmt"
88
"log"
9+
"log/slog"
910
"sort"
1011
"time"
11-
12-
"golang.org/x/exp/slog"
1312
)
1413

1514
type flatAPI struct {

cmd/root.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"os"
1111

1212
"github.com/spf13/cobra"
13+
"go.ntppool.org/common/logger"
1314
"go.ntppool.org/common/version"
1415
)
1516

@@ -32,12 +33,6 @@ func (cli *CLI) rootCmd() *cobra.Command {
3233
var cmd = &cobra.Command{
3334
Use: "data-api",
3435
Short: "A brief description of your application",
35-
Long: `A longer description that spans multiple lines and likely contains
36-
examples and usage of using your application. For example:
37-
38-
Cobra is a CLI library for Go that empowers applications.
39-
This application is a tool to generate the needed files
40-
to quickly create a Cobra application.`,
4136
// Uncomment the following line if your bare application
4237
// has an action associated with it:
4338
// Run: func(cmd *cobra.Command, args []string) { },
@@ -62,6 +57,9 @@ func Execute() {
6257
}
6358

6459
func (cli *CLI) init(cmd *cobra.Command) {
60+
61+
logger.Setup()
62+
6563
cmd.PersistentFlags().StringVar(&cfgFile, "database-config", "database.yaml", "config file (default is $HOME/.data-api.yaml)")
6664

6765
// Cobra also supports local flags, which will only run

go.mod

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
module go.ntppool.org/data-api
22

3-
go 1.20
3+
go 1.21
4+
5+
toolchain go1.21.1
46

57
require (
6-
github.com/ClickHouse/clickhouse-go/v2 v2.10.1
8+
github.com/ClickHouse/clickhouse-go/v2 v2.14.1
79
github.com/go-sql-driver/mysql v1.7.1
8-
github.com/labstack/echo/v4 v4.10.2
10+
github.com/labstack/echo/v4 v4.11.1
911
github.com/spf13/cobra v1.7.0
10-
go.ntppool.org/common v0.1.2-0.20230709041838-03bde25c6df2
11-
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.42.0
12-
go.opentelemetry.io/otel v1.16.0
13-
go.opentelemetry.io/otel/exporters/jaeger v1.16.0
14-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.16.0
15-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.16.0
16-
go.opentelemetry.io/otel/sdk v1.16.0
17-
go.opentelemetry.io/otel/trace v1.16.0
18-
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb
12+
go.ntppool.org/common v0.2.1
13+
go.opentelemetry.io/contrib/instrumentation/github.com/labstack/echo/otelecho v0.44.0
14+
go.opentelemetry.io/otel v1.18.0
15+
go.opentelemetry.io/otel/exporters/jaeger v1.17.0
16+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.18.0
17+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.18.0
18+
go.opentelemetry.io/otel/sdk v1.18.0
19+
go.opentelemetry.io/otel/trace v1.18.0
20+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
1921
golang.org/x/sync v0.3.0
2022
gopkg.in/yaml.v3 v3.0.1
2123
)
2224

2325
require (
24-
github.com/ClickHouse/ch-go v0.57.0 // indirect
26+
github.com/ClickHouse/ch-go v0.58.2 // indirect
2527
github.com/andybalholm/brotli v1.0.5 // indirect
2628
github.com/beorn7/perks v1.0.1 // indirect
2729
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
@@ -32,39 +34,39 @@ require (
3234
github.com/go-logr/stdr v1.2.2 // indirect
3335
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
3436
github.com/golang/protobuf v1.5.3 // indirect
35-
github.com/google/uuid v1.3.0 // indirect
36-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 // indirect
37+
github.com/google/uuid v1.3.1 // indirect
38+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect
3739
github.com/inconshreveable/mousetrap v1.1.0 // indirect
3840
github.com/klauspost/compress v1.16.7 // indirect
3941
github.com/kr/text v0.2.0 // indirect
4042
github.com/labstack/gommon v0.4.0 // indirect
4143
github.com/mattn/go-colorable v0.1.13 // indirect
4244
github.com/mattn/go-isatty v0.0.19 // indirect
4345
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
44-
github.com/paulmach/orb v0.9.2 // indirect
46+
github.com/paulmach/orb v0.10.0 // indirect
4547
github.com/pierrec/lz4/v4 v4.1.18 // indirect
4648
github.com/pkg/errors v0.9.1 // indirect
4749
github.com/prometheus/client_golang v1.16.0 // indirect
4850
github.com/prometheus/client_model v0.4.0 // indirect
4951
github.com/prometheus/common v0.44.0 // indirect
50-
github.com/prometheus/procfs v0.11.0 // indirect
52+
github.com/prometheus/procfs v0.11.1 // indirect
5153
github.com/segmentio/asm v1.2.0 // indirect
5254
github.com/shopspring/decimal v1.3.1 // indirect
5355
github.com/spf13/pflag v1.0.5 // indirect
5456
github.com/valyala/bytebufferpool v1.0.0 // indirect
5557
github.com/valyala/fasttemplate v1.2.2 // indirect
56-
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.16.0 // indirect
57-
go.opentelemetry.io/otel/metric v1.16.0 // indirect
58-
go.opentelemetry.io/proto/otlp v0.20.0 // indirect
59-
golang.org/x/crypto v0.11.0 // indirect
58+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.17.0 // indirect
59+
go.opentelemetry.io/otel/metric v1.18.0 // indirect
60+
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
61+
golang.org/x/crypto v0.13.0 // indirect
6062
golang.org/x/mod v0.12.0 // indirect
61-
golang.org/x/net v0.12.0 // indirect
62-
golang.org/x/sys v0.10.0 // indirect
63-
golang.org/x/text v0.11.0 // indirect
63+
golang.org/x/net v0.15.0 // indirect
64+
golang.org/x/sys v0.12.0 // indirect
65+
golang.org/x/text v0.13.0 // indirect
6466
golang.org/x/time v0.3.0 // indirect
65-
google.golang.org/genproto v0.0.0-20230710151506-e685fd7b542b // indirect
66-
google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98 // indirect
67-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
68-
google.golang.org/grpc v1.56.2 // indirect
67+
google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect
68+
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb // indirect
69+
google.golang.org/genproto/googleapis/rpc v0.0.0-20230913181813-007df8e322eb // indirect
70+
google.golang.org/grpc v1.58.1 // indirect
6971
google.golang.org/protobuf v1.31.0 // indirect
7072
)

0 commit comments

Comments
 (0)