mongo-drivergo.mongodb.org/mongo-driver/internal/codecutil Index | Files

package codecutil

import "go.mongodb.org/mongo-driver/internal/codecutil"

Index

Variables

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

Functions

func MarshalValue

func MarshalValue(val interface{}, 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, error)

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

type MarshalError

type MarshalError struct {
	Value interface{}
	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.

Source Files

encoding.go

Version
v1.17.3 (latest)
Published
Feb 25, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
15 hours ago

Tools for package owners.