Skip to content

Commit f1dd588

Browse files
BradErzBogdan Drutu
authored andcommitted
fix: updated all old imports and using the latest version of mongo-driver (#11)
1 parent 4877de5 commit f1dd588

File tree

9 files changed

+249
-179
lines changed

9 files changed

+249
-179
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ MongoDB Go wrapper source code
33

44
## Table of contents
55
- [End to end example](#end-to-end-example)
6-
- [Traces](#traces)y
6+
- [Traces](#traces)
77
- [Metrics](#metrics)
88

99
## End to end example
@@ -17,9 +17,11 @@ import (
1717
"log"
1818
"time"
1919

20-
"github.com/mongodb/mongo-go-driver/bson"
20+
"go.mongodb.org/mongo-driver/mongo/options"
2121

22-
"github.com/opencensus-integrations/gomongowrapper"
22+
"go.mongodb.org/mongo-driver/bson"
23+
24+
mongowrapper "github.com/opencensus-integrations/gomongowrapper"
2325

2426
"contrib.go.opencensus.io/exporter/stackdriver"
2527
"go.opencensus.io/stats/view"
@@ -53,7 +55,7 @@ func main() {
5355

5456
// Now for the mongo connections, using the context
5557
// with the span in it for continuity.
56-
client, err := mongowrapper.NewClient("mongodb://localhost:27017")
58+
client, err := mongowrapper.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
5759
if err != nil {
5860
log.Fatalf("Failed to create the new client: %v", err)
5961
}

example_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,11 @@ import (
1919
"log"
2020
"time"
2121

22-
"github.com/mongodb/mongo-go-driver/bson"
22+
"go.mongodb.org/mongo-driver/mongo/options"
2323

24-
"github.com/opencensus-integrations/gomongowrapper"
24+
"go.mongodb.org/mongo-driver/bson"
25+
26+
mongowrapper "github.com/opencensus-integrations/gomongowrapper"
2527

2628
"contrib.go.opencensus.io/exporter/stackdriver"
2729
"go.opencensus.io/stats/view"
@@ -55,7 +57,7 @@ func Example() {
5557

5658
// Now for the mongo connections, using the context
5759
// with the span in it for continuity.
58-
client, err := mongowrapper.NewClient("mongodb://localhost:27017")
60+
client, err := mongowrapper.NewClient(options.Client().ApplyURI("mongodb://localhost:27017"))
5961
if err != nil {
6062
log.Fatalf("Failed to create the new client: %v", err)
6163
}

go.mod

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,27 @@ module github.com/opencensus-integrations/gomongowrapper
33
go 1.12
44

55
require (
6-
cloud.google.com/go v0.34.0 // indirect
7-
contrib.go.opencensus.io/exporter/stackdriver v0.8.0
8-
git.apache.org/thrift.git v0.12.0 // indirect
6+
contrib.go.opencensus.io/exporter/stackdriver v0.12.4
7+
github.com/aws/aws-sdk-go v1.21.9 // indirect
98
github.com/go-stack/stack v1.8.0 // indirect
10-
github.com/golang/mock v1.2.0 // indirect
11-
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
12-
github.com/grpc-ecosystem/grpc-gateway v1.6.3 // indirect
13-
github.com/mongodb/mongo-go-driver v0.1.1-0.20181220233027-8051092034cf
14-
github.com/openzipkin/zipkin-go v0.1.3 // indirect
15-
github.com/prometheus/client_golang v0.9.2 // indirect
16-
github.com/prometheus/common v0.0.0-20181218105931-67670fe90761 // indirect
9+
github.com/golang/snappy v0.0.1 // indirect
10+
github.com/google/pprof v0.0.0-20190723021845-34ac40c74b70 // indirect
11+
github.com/hashicorp/golang-lru v0.5.3 // indirect
12+
github.com/kr/pty v1.1.8 // indirect
13+
github.com/stretchr/objx v0.2.0 // indirect
14+
github.com/tidwall/pretty v1.0.0 // indirect
1715
github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c // indirect
1816
github.com/xdg/stringprep v1.0.0 // indirect
19-
go.opencensus.io v0.18.0
20-
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 // indirect
21-
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 // indirect
22-
golang.org/x/net v0.0.0-20181220203305-927f97764cc3 // indirect
23-
golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 // indirect
24-
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect
25-
golang.org/x/sys v0.0.0-20181221143128-b4a75ba826a6 // indirect
26-
golang.org/x/tools v0.0.0-20181221235234-d00ac6d27372 // indirect
27-
google.golang.org/api v0.0.0-20181221000618-65a46cafb132 // indirect
28-
google.golang.org/appengine v1.4.0 // indirect
29-
google.golang.org/genproto v0.0.0-20181221175505-bd9b4fb69e2f // indirect
30-
google.golang.org/grpc v1.17.0 // indirect
31-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
32-
gopkg.in/yaml.v2 v2.2.2 // indirect
33-
honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3 // indirect
17+
go.mongodb.org/mongo-driver v1.0.4
18+
go.opencensus.io v0.22.0
19+
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
20+
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56 // indirect
21+
golang.org/x/image v0.0.0-20190802002840-cff245a6509b // indirect
22+
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 // indirect
23+
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80 // indirect
24+
golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa // indirect
25+
golang.org/x/tools v0.0.0-20190802220118-1d1727260058 // indirect
26+
google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64 // indirect
27+
google.golang.org/grpc v1.22.1 // indirect
28+
honnef.co/go/tools v0.0.1-2019.2.2 // indirect
3429
)

0 commit comments

Comments
 (0)