Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: pass userAgent in client config #118

Merged
merged 3 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions benchmarks/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@ go 1.17
replace github.com/googleapis/go-sql-spanner => ../

require (
cloud.google.com/go v0.102.1
cloud.google.com/go/spanner v1.36.0
cloud.google.com/go v0.104.0
cloud.google.com/go/spanner v1.38.0
github.com/google/uuid v1.3.0
github.com/googleapis/go-sql-spanner v0.0.0-00010101000000-000000000000
google.golang.org/api v0.90.0
google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f
google.golang.org/grpc v1.48.0
google.golang.org/api v0.94.0
google.golang.org/genproto v0.0.0-20220902135211-223410557253
google.golang.org/grpc v1.49.0
google.golang.org/protobuf v1.28.1
)

require (
cloud.google.com/go/compute v1.7.0 // indirect
cloud.google.com/go/compute v1.9.0 // indirect
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 // indirect
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
github.com/cncf/xds/go v0.0.0-20220520190051-1e77728a1eaa // indirect
github.com/envoyproxy/go-control-plane v0.10.3 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/googleapis/gax-go/v2 v2.5.1 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
golang.org/x/sys v0.0.0-20220624220833-87e55d714810 // indirect
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.28.0 // indirect
)
85 changes: 64 additions & 21 deletions benchmarks/go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ func newConnector(d *Driver, dsn string) (*connector, error) {
config.WriteSessions = val
}
}
config.UserAgent = userAgent
c := &connector{
driver: d,
dsn: dsn,
Expand Down
9 changes: 9 additions & 0 deletions driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -55,6 +56,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -68,6 +70,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -81,6 +84,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -96,6 +100,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -111,6 +116,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -127,6 +133,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -142,6 +149,7 @@ func TestExtractDnsParts(t *testing.T) {
},
wantSpannerConfig: spanner.ClientConfig{
SessionPoolConfig: spanner.DefaultSessionPoolConfig,
UserAgent: userAgent,
},
},
{
Expand All @@ -168,6 +176,7 @@ func TestExtractDnsParts(t *testing.T) {
MaxIdle: spanner.DefaultSessionPoolConfig.MaxIdle,
TrackSessionHandles: spanner.DefaultSessionPoolConfig.TrackSessionHandles,
},
UserAgent: userAgent,
},
},
}
Expand Down
36 changes: 18 additions & 18 deletions examples/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,46 @@ go 1.17
replace github.com/googleapis/go-sql-spanner => ../

require (
cloud.google.com/go v0.102.1
cloud.google.com/go/spanner v1.36.0
cloud.google.com/go v0.104.0
cloud.google.com/go/spanner v1.38.0
github.com/docker/docker v20.10.17+incompatible
github.com/docker/go-connections v0.4.0
github.com/googleapis/go-sql-spanner v0.0.0-00010101000000-000000000000
google.golang.org/genproto v0.0.0-20220801145646-83ce21fca29f
google.golang.org/genproto v0.0.0-20220902135211-223410557253
)

require (
cloud.google.com/go/compute v1.7.0 // indirect
cloud.google.com/go/compute v1.9.0 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/census-instrumentation/opencensus-proto v0.3.0 // indirect
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4 // indirect
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cncf/udpa/go v0.0.0-20220112060539-c52dc94e7fbe // indirect
github.com/cncf/xds/go v0.0.0-20220520190051-1e77728a1eaa // indirect
github.com/docker/distribution v2.8.1+incompatible // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/envoyproxy/go-control-plane v0.10.2-0.20220325020618-49ff273808a1 // indirect
github.com/envoyproxy/protoc-gen-validate v0.1.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/envoyproxy/go-control-plane v0.10.3 // indirect
github.com/envoyproxy/protoc-gen-validate v0.6.7 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.1.0 // indirect
github.com/googleapis/gax-go/v2 v2.4.0 // indirect
github.com/googleapis/gax-go/v2 v2.5.1 // indirect
github.com/moby/term v0.0.0-20220808134915-39b0c02b01ae // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect
go.opencensus.io v0.23.0 // indirect
golang.org/x/net v0.0.0-20220624214902-1bab6f366d9e // indirect
golang.org/x/oauth2 v0.0.0-20220622183110-fd043fe589d2 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b // indirect
golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094 // indirect
golang.org/x/sys v0.0.0-20220829200755-d48e67d00261 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect
google.golang.org/api v0.90.0 // indirect
google.golang.org/api v0.94.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/grpc v1.48.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
google.golang.org/grpc v1.49.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gotest.tools/v3 v3.3.0 // indirect
)
Loading