bsontype

package
v1.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 0 Imported by: 845

Documentation

Overview

Package bsontype is a utility package that contains types for each BSON type and the a stringifier for the Type to enable easier debugging when working with BSON.

Index

Constants

View Source
const (
	BinaryGeneric     byte = 0x00
	BinaryFunction    byte = 0x01
	BinaryBinaryOld   byte = 0x02
	BinaryUUIDOld     byte = 0x03
	BinaryUUID        byte = 0x04
	BinaryMD5         byte = 0x05
	BinaryEncrypted   byte = 0x06
	BinaryColumn      byte = 0x07
	BinarySensitive   byte = 0x08
	BinaryUserDefined byte = 0x80
)

BSON binary element subtypes as described in https://bsonspec.org/spec.html.

Deprecated: Use the bson.TypeBinary* constants instead.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type byte

Type represents a BSON type.

const (
	Double           Type = 0x01
	String           Type = 0x02
	EmbeddedDocument Type = 0x03
	Array            Type = 0x04
	Binary           Type = 0x05
	Undefined        Type = 0x06
	ObjectID         Type = 0x07
	Boolean          Type = 0x08
	DateTime         Type = 0x09
	Null             Type = 0x0A
	Regex            Type = 0x0B
	DBPointer        Type = 0x0C
	JavaScript       Type = 0x0D
	Symbol           Type = 0x0E
	CodeWithScope    Type = 0x0F
	Int32            Type = 0x10
	Timestamp        Type = 0x11
	Int64            Type = 0x12
	Decimal128       Type = 0x13
	MinKey           Type = 0xFF
	MaxKey           Type = 0x7F
)

BSON element types as described in https://bsonspec.org/spec.html.

Deprecated: Use bson.Type* constants instead.

func (Type) IsValid added in v1.12.1

func (bt Type) IsValid() bool

IsValid will return true if the Type is valid.

func (Type) String

func (bt Type) String() string

String returns the string representation of the BSON type's name.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL