summaryrefslogtreecommitdiff
path: root/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-03-25 11:00:36 +0000
committerLibravatar GitHub <noreply@github.com>2024-03-25 11:00:36 +0000
commit29031d1e274360f5fe8c53e56d1b0ae71628795f (patch)
tree54149ea2a80e863349e3cd8c02e6a6d1b3fcfe3f /vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
parent[chore]: Bump github.com/coreos/go-oidc/v3 from 3.9.0 to 3.10.0 (#2779) (diff)
downloadgotosocial-29031d1e274360f5fe8c53e56d1b0ae71628795f.tar.xz
[chore]: Bump github.com/gin-contrib/sessions from 0.0.5 to 1.0.0 (#2782)
Diffstat (limited to 'vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go')
-rw-r--r--vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
index 65964f420..f8b76f996 100644
--- a/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
+++ b/vendor/go.mongodb.org/mongo-driver/bson/bsonoptions/string_codec_options.go
@@ -9,23 +9,34 @@ package bsonoptions
var defaultDecodeOIDAsHex = true
// StringCodecOptions represents all possible options for string encoding and decoding.
+//
+// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
+// and unmarshal behavior instead.
type StringCodecOptions struct {
DecodeObjectIDAsHex *bool // Specifies if we should decode ObjectID as the hex value. Defaults to true.
}
// StringCodec creates a new *StringCodecOptions
+//
+// Deprecated: Use the bson.Encoder and bson.Decoder configuration methods to set the desired BSON marshal
+// and unmarshal behavior instead.
func StringCodec() *StringCodecOptions {
return &StringCodecOptions{}
}
// SetDecodeObjectIDAsHex specifies if object IDs should be decoded as their hex representation. If false, a string made
// from the raw object ID bytes will be used. Defaults to true.
+//
+// Deprecated: Decoding object IDs as raw bytes will not be supported in Go Driver 2.0.
func (t *StringCodecOptions) SetDecodeObjectIDAsHex(b bool) *StringCodecOptions {
t.DecodeObjectIDAsHex = &b
return t
}
// MergeStringCodecOptions combines the given *StringCodecOptions into a single *StringCodecOptions in a last one wins fashion.
+//
+// Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a
+// single options struct instead.
func MergeStringCodecOptions(opts ...*StringCodecOptions) *StringCodecOptions {
s := &StringCodecOptions{&defaultDecodeOIDAsHex}
for _, opt := range opts {