codecutil

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilValue = errors.New("value is nil")

Functions

func MarshalValue

func MarshalValue(val any, encFn EncoderFn) (bsoncore.Value, error)

MarshalValue will attempt to encode the value with the encoder returned by the encoder function.

Types

type EncoderFn

type EncoderFn func(io.Writer) *bson.Encoder

EncoderFn is used to functionally construct an encoder for marshaling values.

type MarshalError

type MarshalError struct {
	Value any
	Err   error
}

MarshalError is returned when attempting to transform a value into a document results in an error.

func (MarshalError) Error

func (e MarshalError) Error() string

Error implements the error interface.

func (MarshalError) Unwrap added in v2.3.0

func (e MarshalError) Unwrap() error

Jump to

Keyboard shortcuts

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