codec

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringObjectIDCodec

type StringObjectIDCodec struct{}

StringObjectIDCodec is the Codec used for string values. It tries to convert strings into [bson.ObjectID].

func (StringObjectIDCodec) EncodeValue

EncodeValue implements the bsoncodec.ValueEncoder interface. The method tries to convert a string value into [bson.ObjectID].

  • If a string can be converted into [bson.ObjectID] it returns it as a [bson.ObjectID].
  • If a string cannot be converted into [bson.ObjectID] it returns it as a string, without any transformations.

Jump to

Keyboard shortcuts

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