Skip to content

Commit d685dac

Browse files
committed
Restructure repository
Renamed dispatch package to driver and moved under x/mongo. Split core library into driver and network libraries, and moved libraries under the appropriate directory. Updated Makefile and fixed linting errors. GODRIVER-614 Change-Id: I480a7aa46ed8aa82f07f0dccb782cba33b049362
1 parent 03d16bb commit d685dac

File tree

262 files changed

+712
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+712
-705
lines changed

.errcheck-excludes

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
(*github.com/mongodb/mongo-go-driver/core/connection.connection).Close
2-
(github.com/mongodb/mongo-go-driver/core/connection.Connection).Close
3-
(*github.com/mongodb/mongo-go-driver/core/topology.Subscription).Unsubscribe
4-
(*github.com/mongodb/mongo-go-driver/core/topology.Server).Close
5-
(*github.com/mongodb/mongo-go-driver/core/connection.pool).closeConnection
6-
(github.com/mongodb/mongo-go-driver/core/wiremessage.ReadWriteCloser).Close
1+
(*github.com/mongodb/mongo-go-driver/x/network/connection.connection).Close
2+
(github.com/mongodb/mongo-go-driver/x/network/connection.Connection).Close
3+
(*github.com/mongodb/mongo-go-driver/x/mongo/driver/topology.Subscription).Unsubscribe
4+
(*github.com/mongodb/mongo-go-driver/x/mongo/driver/topology.Server).Close
5+
(*github.com/mongodb/mongo-go-driver/x/network/connection.pool).closeConnection
6+
(github.com/mongodb/mongo-go-driver/x/network/wiremessage.ReadWriteCloser).Close
77
(github.com/mongodb/mongo-go-driver/mongo.Cursor).Close
88
(net.Conn).Close
99
encoding/pem.Encode

Makefile

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
BSON_PKGS = $(shell ./etc/find_pkgs.sh ./bson)
2-
BSON_TEST_PKGS = $(shell ./etc/find_pkgs.sh ./bson _test)
3-
MONGO_PKGS = $(shell ./etc/find_pkgs.sh ./mongo)
4-
MONGO_TEST_PKGS = $(shell ./etc/find_pkgs.sh ./mongo _test)
5-
CORE_PKGS = $(shell ./etc/find_pkgs.sh ./core)
6-
CORE_TEST_PKGS = $(shell ./etc/find_pkgs.sh ./core _test)
7-
UNSTABLE_PKGS = $(shell ./etc/find_pkgs.sh ./x)
8-
UNSTABLE_TEST_PKGS = $(shell ./etc/find_pkgs.sh ./x _test)
9-
PKGS = $(BSON_PKGS) $(MONGO_PKGS) $(CORE_PKGS) $(UNSTABLE_PKGS)
10-
TEST_PKGS = $(BSON_TEST_PKGS) $(MONGO_TEST_PKGS) $(CORE_TEST_PKGS) $(UNSTABLE_TEST_PKGS)
1+
BSON_PKGS = $(shell etc/list_pkgs.sh ./bson)
2+
BSON_TEST_PKGS = $(shell etc/list_test_pkgs.sh ./bson)
3+
MONGO_PKGS = $(shell etc/list_pkgs.sh ./mongo)
4+
MONGO_TEST_PKGS = $(shell etc/list_test_pkgs.sh ./mongo)
5+
UNSTABLE_PKGS = $(shell etc/list_pkgs.sh ./x)
6+
UNSTABLE_TEST_PKGS = $(shell etc/list_test_pkgs.sh ./x)
7+
TAG_PKG = $(shell etc/list_pkgs.sh ./tag)
8+
TAG_TEST_PKG = $(shell etc/list_test_pkgs.sh ./tag)
9+
PKGS = $(BSON_PKGS) $(MONGO_PKGS) $(UNSTABLE_PKGS) $(TAG_PKG)
10+
TEST_PKGS = $(BSON_TEST_PKGS) $(MONGO_TEST_PKGS) $(UNSTABLE_TEST_PKGS) $(TAG_PKG)
1111

1212
TEST_TIMEOUT = 600
1313

@@ -20,7 +20,7 @@ doc:
2020

2121
.PHONY: build-examples
2222
build-examples:
23-
go build $(BUILD_TAGS) ./examples/... ./core/examples/...
23+
go build $(BUILD_TAGS) ./examples/... ./x/network/examples/...
2424

2525
.PHONY: build
2626
build:
@@ -45,7 +45,7 @@ lint-add-whitelist:
4545

4646
.PHONY: errcheck
4747
errcheck:
48-
errcheck -exclude .errcheck-excludes ./bson/... ./mongo/... ./core/...
48+
errcheck -exclude .errcheck-excludes ./bson/... ./mongo/... ./x/...
4949

5050
.PHONY: test
5151
test:
@@ -97,7 +97,7 @@ update-notices:
9797

9898
.PHONY: vet
9999
vet:
100-
go tool vet -cgocall=false -composites=false -structtags=false -unusedstringmethods="Error" $(PKGS)
100+
go vet -cgocall=false -composites=false -structtags=false -unusedstringmethods="Error" $(PKGS)
101101

102102

103103
# Evergreen specific targets
@@ -107,7 +107,7 @@ evg-test:
107107

108108
.PHONY: evg-test-auth
109109
evg-test-auth:
110-
go run -tags gssapi ./core/examples/count/main.go -uri $(MONGODB_URI)
110+
go run -tags gssapi ./x/network/examples/count/main.go -uri $(MONGODB_URI)
111111

112112
# benchmark specific targets and support
113113
perf:driver-test-data.tar.gz

core/README.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

core/doc.go

Lines changed: 0 additions & 23 deletions
This file was deleted.

etc/find_pkgs.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

etc/list_pkgs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# list_pkgs <directory>
3+
directory="$1"
4+
if [ -z "$directory" ]; then
5+
directory="."
6+
fi
7+
go list $directory/... | sed -e "s/^github.com\/mongodb\/mongo-go-driver/./"

etc/list_test_pkgs.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# list_pkgs <directory>
3+
directory="$1"
4+
if [ -z "$directory" ]; then
5+
directory="."
6+
fi
7+
go list -test -f '{{.ForTest}}' $directory/... | sed -e "s/^github.com\/mongodb\/mongo-go-driver/./"
File renamed without changes.

examples/documentation_examples/examples.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
"github.com/mongodb/mongo-go-driver/bson"
1717
"github.com/mongodb/mongo-go-driver/bson/primitive"
1818
"github.com/mongodb/mongo-go-driver/mongo"
19-
"github.com/mongodb/mongo-go-driver/options"
19+
"github.com/mongodb/mongo-go-driver/mongo/options"
2020
"github.com/mongodb/mongo-go-driver/x/bsonx"
2121
"github.com/stretchr/testify/require"
2222
)

internal/channel_connection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
"testing"
1212

1313
"github.com/mongodb/mongo-go-driver/bson"
14-
"github.com/mongodb/mongo-go-driver/core/wiremessage"
1514
"github.com/mongodb/mongo-go-driver/x/bsonx"
15+
"github.com/mongodb/mongo-go-driver/x/network/wiremessage"
1616
)
1717

1818
// Implements the connection.Connection interface by reading and writing wire messages

0 commit comments

Comments
 (0)