forcecast

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoArrayType           = errors.New("value is not valid array")
	ErrImpossibleCastToArray = errors.New("impossible to cast input to array")
)
View Source
var ErrInvalidTypeForObjectID = errors.New("ObjectID must be string (24 characters) or array (12 bytes)")

Functions

This section is empty.

Types

type ForceCast

type ForceCast interface {
	Cast(value interface{}) (interface{}, error)
	ZeroValue() interface{}
}

type ObjectIDArrayCast

type ObjectIDArrayCast struct{}

func (ObjectIDArrayCast) Cast

func (o ObjectIDArrayCast) Cast(input interface{}) (interface{}, error)

func (ObjectIDArrayCast) ZeroValue

func (o ObjectIDArrayCast) ZeroValue() interface{}

type ObjectIDCast

type ObjectIDCast struct{}

func (ObjectIDCast) Cast

func (o ObjectIDCast) Cast(input interface{}) (interface{}, error)

func (ObjectIDCast) ZeroValue

func (o ObjectIDCast) ZeroValue() interface{}

Jump to

Keyboard shortcuts

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