bsonoptions

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MapCodecOptions

type MapCodecOptions struct {
	DecodeZerosMap *bool // Specifies if the map should be zeroed before decoding into it. Defaults to false.
}

MapCodecOptions represents all possible options for map encoding and decoding.

func MapCodec

func MapCodec() *MapCodecOptions

MapCodec creates a new *MapCodecOptions

func MergeMapCodecOptions

func MergeMapCodecOptions(opts ...*MapCodecOptions) *MapCodecOptions

MergeMapCodecOptions combines the given *MapCodecOptions into a single *MapCodecOptions in a last one wins fashion.

func (*MapCodecOptions) SetDecodeZerosMap

func (t *MapCodecOptions) SetDecodeZerosMap(b bool) *MapCodecOptions

SetDecodeZerosMap specifies if the map should be zeroed before decoding into it. Defaults to false.

type StringCodecOptions

type StringCodecOptions struct {
	DecodeObjectIDAsHex *bool // Specifies if we should decode ObjectID as the hex value. Defaults to true.
}

StringCodecOptions represents all possible options for string encoding and decoding.

func MergeStringCodecOptions

func MergeStringCodecOptions(opts ...*StringCodecOptions) *StringCodecOptions

MergeStringCodecOptions combines the given *StringCodecOptions into a single *StringCodecOptions in a last one wins fashion.

func StringCodec

func StringCodec() *StringCodecOptions

StringCodec creates a new *StringCodecOptions

func (*StringCodecOptions) SetDecodeObjectIDAsHex

func (t *StringCodecOptions) SetDecodeObjectIDAsHex(b bool) *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.

type StructCodecOptions

type StructCodecOptions struct {
	DecodeZeroStruct        *bool // Specifies if structs should be zeroed before decoding into them. Defaults to false.
	DecodeDeepZeroInline    *bool // Specifies if structs should be recursively zeroed when a inline value is decoded. Defaults to false.
	EncodeOmitDefaultStruct *bool // Specifies if default structs should be considered empty by omitempty. Defaults to false.
	AllowUnexportedFields   *bool // Specifies if unexported fields should be marshaled/unmarshaled. Defaults to false.
}

StructCodecOptions represents all possible options for struct encoding and decoding.

func MergeStructCodecOptions

func MergeStructCodecOptions(opts ...*StructCodecOptions) *StructCodecOptions

MergeStructCodecOptions combines the given *StructCodecOptions into a single *StructCodecOptions in a last one wins fashion.

func StructCodec

func StructCodec() *StructCodecOptions

StructCodec creates a new *StructCodecOptions

func (*StructCodecOptions) SetAllowUnexportedFields

func (t *StructCodecOptions) SetAllowUnexportedFields(b bool) *StructCodecOptions

SetAllowUnexportedFields specifies if unexported fields should be marshaled/unmarshaled. Defaults to false.

func (*StructCodecOptions) SetDecodeDeepZeroInline

func (t *StructCodecOptions) SetDecodeDeepZeroInline(b bool) *StructCodecOptions

SetDecodeDeepZeroInline specifies if structs should be zeroed before decoding into them. Defaults to false.

func (*StructCodecOptions) SetDecodeZeroStruct

func (t *StructCodecOptions) SetDecodeZeroStruct(b bool) *StructCodecOptions

SetDecodeZeroStruct specifies if structs should be zeroed before decoding into them. Defaults to false.

func (*StructCodecOptions) SetEncodeOmitDefaultStruct

func (t *StructCodecOptions) SetEncodeOmitDefaultStruct(b bool) *StructCodecOptions

SetEncodeOmitDefaultStruct specifies if default structs should be considered empty by omitempty. A default struct has all its values set to their default value. Defaults to false.

type TimeCodecOptions

type TimeCodecOptions struct {
	UseLocalTimeZone *bool // Specifies if we should decode into the local time zone. Defaults to false.
}

TimeCodecOptions represents all possible options for time.Time encoding and decoding.

func MergeTimeCodecOptions

func MergeTimeCodecOptions(opts ...*TimeCodecOptions) *TimeCodecOptions

MergeTimeCodecOptions combines the given *TimeCodecOptions into a single *TimeCodecOptions in a last one wins fashion.

func TimeCodec

func TimeCodec() *TimeCodecOptions

TimeCodec creates a new *TimeCodecOptions

func (*TimeCodecOptions) SetUseLocalTimeZone

func (t *TimeCodecOptions) SetUseLocalTimeZone(b bool) *TimeCodecOptions

SetUseLocalTimeZone specifies if we should decode into the local time zone. Defaults to false.

Jump to

Keyboard shortcuts

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