Skip to content

Commit 4faad42

Browse files
author
iwysiu
authored
GODRIVER-1361 enable MgoRegistry (#282)
1 parent 162084c commit 4faad42

File tree

5 files changed

+113
-161
lines changed

5 files changed

+113
-161
lines changed

bson/bsoncodec/default_value_decoders.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,8 @@ func (dvd DefaultValueDecoders) IntDecodeValue(dc DecodeContext, vr bsonrw.Value
222222
}
223223

224224
// UintDecodeValue is the ValueDecoderFunc for uint types.
225+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
226+
// future. Use UIntCodec.DecodeValue instead.
225227
func (dvd DefaultValueDecoders) UintDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
226228
var i64 int64
227229
var err error
@@ -355,6 +357,8 @@ func (dvd DefaultValueDecoders) FloatDecodeValue(ec DecodeContext, vr bsonrw.Val
355357
}
356358

357359
// StringDecodeValue is the ValueDecoderFunc for string types.
360+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
361+
// future. Use StringCodec.DecodeValue instead.
358362
func (dvd DefaultValueDecoders) StringDecodeValue(dctx DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
359363
var str string
360364
var err error
@@ -681,6 +685,8 @@ func (dvd DefaultValueDecoders) URLDecodeValue(dc DecodeContext, vr bsonrw.Value
681685
}
682686

683687
// TimeDecodeValue is the ValueDecoderFunc for time.Time.
688+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
689+
// future. Use Time.DecodeValue instead.
684690
func (dvd DefaultValueDecoders) TimeDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
685691
if vr.Type() != bsontype.DateTime {
686692
return fmt.Errorf("cannot decode %v into a time.Time", vr.Type())
@@ -700,6 +706,8 @@ func (dvd DefaultValueDecoders) TimeDecodeValue(dc DecodeContext, vr bsonrw.Valu
700706
}
701707

702708
// ByteSliceDecodeValue is the ValueDecoderFunc for []byte.
709+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
710+
// future. Use ByteSliceCodec.DecodeValue instead.
703711
func (dvd DefaultValueDecoders) ByteSliceDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
704712
if vr.Type() != bsontype.Binary && vr.Type() != bsontype.Null {
705713
return fmt.Errorf("cannot decode %v into a []byte", vr.Type())
@@ -727,6 +735,8 @@ func (dvd DefaultValueDecoders) ByteSliceDecodeValue(dc DecodeContext, vr bsonrw
727735
}
728736

729737
// MapDecodeValue is the ValueDecoderFunc for map[string]* types.
738+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
739+
// future. Use Map.DecodeValue instead.
730740
func (dvd DefaultValueDecoders) MapDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
731741
if !val.CanSet() || val.Kind() != reflect.Map || val.Type().Key().Kind() != reflect.String {
732742
return ValueDecoderError{Name: "MapDecodeValue", Kinds: []reflect.Kind{reflect.Map}, Received: val}
@@ -843,6 +853,8 @@ func (dvd DefaultValueDecoders) ArrayDecodeValue(dc DecodeContext, vr bsonrw.Val
843853
}
844854

845855
// SliceDecodeValue is the ValueDecoderFunc for slice types.
856+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
857+
// future. Use SliceCodec.DecodeValue instead.
846858
func (dvd DefaultValueDecoders) SliceDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
847859
if !val.CanSet() || val.Kind() != reflect.Slice {
848860
return ValueDecoderError{Name: "SliceDecodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val}
@@ -952,6 +964,8 @@ func (dvd DefaultValueDecoders) UnmarshalerDecodeValue(dc DecodeContext, vr bson
952964
}
953965

954966
// EmptyInterfaceDecodeValue is the ValueDecoderFunc for interface{}.
967+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
968+
// future. Use EmptyInterfaceCodec.DecodeValue instead.
955969
func (dvd DefaultValueDecoders) EmptyInterfaceDecodeValue(dc DecodeContext, vr bsonrw.ValueReader, val reflect.Value) error {
956970
if !val.CanSet() || val.Type() != tEmpty {
957971
return ValueDecoderError{Name: "EmptyInterfaceDecodeValue", Types: []reflect.Type{tEmpty}, Received: val}

bson/bsoncodec/default_value_encoders.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ func (dve DefaultValueEncoders) IntEncodeValue(ec EncodeContext, vw bsonrw.Value
150150
}
151151

152152
// UintEncodeValue is the ValueEncoderFunc for uint types.
153+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
154+
// future. Use UIntCodec.EncodeValue instead.
153155
func (dve DefaultValueEncoders) UintEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
154156
switch val.Kind() {
155157
case reflect.Uint8, reflect.Uint16:
@@ -183,6 +185,8 @@ func (dve DefaultValueEncoders) FloatEncodeValue(ec EncodeContext, vw bsonrw.Val
183185
}
184186

185187
// StringEncodeValue is the ValueEncoderFunc for string types.
188+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
189+
// future. Use StringCodec.EncodeValue instead.
186190
func (dve DefaultValueEncoders) StringEncodeValue(ectx EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
187191
if val.Kind() != reflect.String {
188192
return ValueEncoderError{
@@ -241,6 +245,8 @@ func (dve DefaultValueEncoders) URLEncodeValue(ec EncodeContext, vw bsonrw.Value
241245
}
242246

243247
// TimeEncodeValue is the ValueEncoderFunc for time.TIme.
248+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
249+
// future. Use TimeCodec.EncodeValue instead.
244250
func (dve DefaultValueEncoders) TimeEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
245251
if !val.IsValid() || val.Type() != tTime {
246252
return ValueEncoderError{Name: "TimeEncodeValue", Types: []reflect.Type{tTime}, Received: val}
@@ -250,6 +256,8 @@ func (dve DefaultValueEncoders) TimeEncodeValue(ec EncodeContext, vw bsonrw.Valu
250256
}
251257

252258
// ByteSliceEncodeValue is the ValueEncoderFunc for []byte.
259+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
260+
// future. Use ByteSliceCodec.EncodeValue instead.
253261
func (dve DefaultValueEncoders) ByteSliceEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
254262
if !val.IsValid() || val.Type() != tByteSlice {
255263
return ValueEncoderError{Name: "ByteSliceEncodeValue", Types: []reflect.Type{tByteSlice}, Received: val}
@@ -261,6 +269,8 @@ func (dve DefaultValueEncoders) ByteSliceEncodeValue(ec EncodeContext, vw bsonrw
261269
}
262270

263271
// MapEncodeValue is the ValueEncoderFunc for map[string]* types.
272+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
273+
// future. Use MapCodec.EncodeValue instead.
264274
func (dve DefaultValueEncoders) MapEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
265275
if !val.IsValid() || val.Kind() != reflect.Map || val.Type().Key().Kind() != reflect.String {
266276
return ValueEncoderError{Name: "MapEncodeValue", Kinds: []reflect.Kind{reflect.Map}, Received: val}
@@ -409,6 +419,8 @@ func (dve DefaultValueEncoders) ArrayEncodeValue(ec EncodeContext, vw bsonrw.Val
409419
}
410420

411421
// SliceEncodeValue is the ValueEncoderFunc for slice types.
422+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
423+
// future. Use SliceCodec.EncodeValue instead.
412424
func (dve DefaultValueEncoders) SliceEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
413425
if !val.IsValid() || val.Kind() != reflect.Slice {
414426
return ValueEncoderError{Name: "SliceEncodeValue", Kinds: []reflect.Kind{reflect.Slice}, Received: val}
@@ -489,6 +501,8 @@ func (dve DefaultValueEncoders) lookupElementEncoder(ec EncodeContext, origEncod
489501
}
490502

491503
// EmptyInterfaceEncodeValue is the ValueEncoderFunc for interface{}.
504+
// This method is deprecated and does not have any stability guarantees. It may be removed in the
505+
// future. Use EmptyInterfaceCodec.EncodeValue instead.
492506
func (dve DefaultValueEncoders) EmptyInterfaceEncodeValue(ec EncodeContext, vw bsonrw.ValueWriter, val reflect.Value) error {
493507
if !val.IsValid() || val.Type() != tEmpty {
494508
return ValueEncoderError{Name: "EmptyInterfaceEncodeValue", Types: []reflect.Type{tEmpty}, Received: val}

0 commit comments

Comments
 (0)