Skip to content

Commit 8ccaef4

Browse files
committed
GODRIVER-249 Move options package into private
Change-Id: Ibc024f0c422d45fdcca8189f8852c52defcf7e7a
1 parent 18258e5 commit 8ccaef4

20 files changed

+27
-27
lines changed

mongo/change_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import (
1313

1414
"github.com/mongodb/mongo-go-driver/bson"
1515
"github.com/mongodb/mongo-go-driver/mongo/internal"
16-
"github.com/mongodb/mongo-go-driver/mongo/options"
1716
"github.com/mongodb/mongo-go-driver/mongo/private/conn"
1817
"github.com/mongodb/mongo-go-driver/mongo/private/ops"
18+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1919
)
2020

2121
// ErrMissingResumeToken indicates that a change stream notification from the server did not

mongo/change_stream_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88

99
"github.com/mongodb/mongo-go-driver/bson"
1010
"github.com/mongodb/mongo-go-driver/mongo/internal"
11-
"github.com/mongodb/mongo-go-driver/mongo/options"
1211
"github.com/mongodb/mongo-go-driver/mongo/private/conn"
1312
"github.com/mongodb/mongo-go-driver/mongo/private/ops"
13+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1414
"github.com/stretchr/testify/require"
1515
)
1616

mongo/collection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"strings"
1515

1616
"github.com/mongodb/mongo-go-driver/bson"
17-
"github.com/mongodb/mongo-go-driver/mongo/options"
1817
"github.com/mongodb/mongo-go-driver/mongo/private/cluster"
1918
"github.com/mongodb/mongo-go-driver/mongo/private/ops"
19+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
2020
"github.com/mongodb/mongo-go-driver/mongo/readconcern"
2121
"github.com/mongodb/mongo-go-driver/mongo/readpref"
2222
"github.com/mongodb/mongo-go-driver/mongo/writeconcern"

mongo/collection_internal_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/mongodb/mongo-go-driver/bson"
1515
"github.com/mongodb/mongo-go-driver/bson/objectid"
1616
"github.com/mongodb/mongo-go-driver/mongo/internal/testutil"
17-
"github.com/mongodb/mongo-go-driver/mongo/options"
17+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1818
"github.com/stretchr/testify/require"
1919
)
2020

@@ -163,7 +163,7 @@ func TestCollection_DeleteOne_notFound_withOption(t *testing.T) {
163163
initCollection(t, coll)
164164

165165
filter := bson.NewDocument(bson.EC.Int32("x", 0))
166-
result, err := coll.DeleteOne(context.Background(), filter, Opt.Collation(&options.CollationOptions{Locale: "en_US"}))
166+
result, err := coll.DeleteOne(context.Background(), filter, Opt.Collation(&options.Collation{Locale: "en_US"}))
167167
require.Nil(t, err)
168168
require.Equal(t, result.DeletedCount, int64(0))
169169
}
@@ -217,7 +217,7 @@ func TestCollection_DeleteMany_notFound_withOption(t *testing.T) {
217217
filter := bson.NewDocument(
218218
bson.EC.SubDocumentFromElements("x", bson.EC.Int32("$lt", 1)))
219219

220-
result, err := coll.DeleteMany(context.Background(), filter, Opt.Collation(&options.CollationOptions{Locale: "en_US"}))
220+
result, err := coll.DeleteMany(context.Background(), filter, Opt.Collation(&options.Collation{Locale: "en_US"}))
221221
require.Nil(t, err)
222222
require.Equal(t, result.DeletedCount, int64(0))
223223
}
@@ -615,7 +615,7 @@ func TestCollection_Distinct_withOption(t *testing.T) {
615615
coll := createTestCollection(t, nil, nil)
616616
initCollection(t, coll)
617617

618-
results, err := coll.Distinct(context.Background(), "x", nil, Opt.Collation(&options.CollationOptions{Locale: "en_US"}))
618+
results, err := coll.Distinct(context.Background(), "x", nil, Opt.Collation(&options.Collation{Locale: "en_US"}))
619619
require.Nil(t, err)
620620
require.Equal(t, results, []interface{}{int32(1), int32(2), int32(3), int32(4), int32(5)})
621621
}

mongo/crud_spec_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/mongodb/mongo-go-driver/bson"
1515
"github.com/mongodb/mongo-go-driver/bson/extjson"
1616
"github.com/mongodb/mongo-go-driver/mongo/internal/testutil/helpers"
17-
"github.com/mongodb/mongo-go-driver/mongo/options"
17+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1818
"github.com/stretchr/testify/require"
1919
)
2020

@@ -884,8 +884,8 @@ func verifyCursorResults(t *testing.T, cursor Cursor, result json.RawMessage) {
884884

885885
}
886886

887-
func collationFromMap(m map[string]interface{}) *options.CollationOptions {
888-
var collation options.CollationOptions
887+
func collationFromMap(m map[string]interface{}) *options.Collation {
888+
var collation options.Collation
889889

890890
if locale, found := m["locale"]; found {
891891
collation.Locale = locale.(string)

mongo/options.go

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

1212
"github.com/mongodb/mongo-go-driver/bson"
13-
"github.com/mongodb/mongo-go-driver/mongo/options"
13+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1414
"github.com/mongodb/mongo-go-driver/mongo/readconcern"
1515
"github.com/mongodb/mongo-go-driver/mongo/writeconcern"
1616
)
@@ -68,7 +68,7 @@ func (Options) BypassDocumentValidation(b bool) options.OptBypassDocumentValidat
6868
// for lettercase and accent marks.
6969
//
7070
// See https://docs.mongodb.com/manual/reference/collation/.
71-
func (Options) Collation(collation *options.CollationOptions) options.OptCollation {
71+
func (Options) Collation(collation *options.Collation) options.OptCollation {
7272
opt := options.OptCollation{Collation: collation}
7373
return opt
7474
}

mongo/private/ops/aggregate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/mongodb/mongo-go-driver/bson"
1414
"github.com/mongodb/mongo-go-driver/mongo/internal"
15-
"github.com/mongodb/mongo-go-driver/mongo/options"
15+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1616
)
1717

1818
// Aggregate performs an aggregation.

mongo/private/ops/count.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/mongodb/mongo-go-driver/bson"
1414
"github.com/mongodb/mongo-go-driver/mongo/internal"
15-
"github.com/mongodb/mongo-go-driver/mongo/options"
15+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1616
)
1717

1818
// Count counts how many documents in a collection match a given query.

mongo/private/ops/delete.go

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

1212
"github.com/mongodb/mongo-go-driver/bson"
1313
"github.com/mongodb/mongo-go-driver/mongo/internal"
14-
"github.com/mongodb/mongo-go-driver/mongo/options"
14+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1515
)
1616

1717
// Delete executes an delete command with a given set of delete documents and options.

mongo/private/ops/distinct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/mongodb/mongo-go-driver/bson"
1414
"github.com/mongodb/mongo-go-driver/mongo/internal"
15-
"github.com/mongodb/mongo-go-driver/mongo/options"
15+
"github.com/mongodb/mongo-go-driver/mongo/private/options"
1616
)
1717

1818
// Distinct returns the distinct values for a specified field across a single collection.

0 commit comments

Comments
 (0)