codecutil

package
v1.13.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 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 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.

Jump to

Keyboard shortcuts

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