podman

Форк
0
24 строки · 1013.0 Байт
1
// Copyright (C) MongoDB, Inc. 2017-present.
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License"); you may
4
// not use this file except in compliance with the License. You may obtain
5
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
6

7
package bson
8

9
import "go.mongodb.org/mongo-driver/bson/bsoncodec"
10

11
// DefaultRegistry is the default bsoncodec.Registry. It contains the default codecs and the
12
// primitive codecs.
13
var DefaultRegistry = NewRegistryBuilder().Build()
14

15
// NewRegistryBuilder creates a new RegistryBuilder configured with the default encoders and
16
// decoders from the bsoncodec.DefaultValueEncoders and bsoncodec.DefaultValueDecoders types and the
17
// PrimitiveCodecs type in this package.
18
func NewRegistryBuilder() *bsoncodec.RegistryBuilder {
19
	rb := bsoncodec.NewRegistryBuilder()
20
	bsoncodec.DefaultValueEncoders{}.RegisterDefaultEncoders(rb)
21
	bsoncodec.DefaultValueDecoders{}.RegisterDefaultDecoders(rb)
22
	primitiveCodecs.RegisterPrimitiveCodecs(rb)
23
	return rb
24
}
25

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.