automapper

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Map

func Map(source, dest interface{}, options ...MapOptions) error

Map fills out the fields in dest with values from source. All fields in the destination object must exist in the source object.

Object hierarchies with nested structs and slices are supported, as long as type types of nested structs/slices follow the same rules, i.e. all fields in destination structs must be found on the source struct.

Embedded/anonymous structs are supported

Values that are not exported/not public will not be mapped.

It is a design decision to panic when a field cannot be mapped in the destination to ensure that a renamed field in either the source or destination does not result in subtle silent bug.

Types

type MapOptions added in v0.0.19

type MapOptions int64
const (
	Loose                  MapOptions = 1
	RequestForm            MapOptions = 2
	RequestFormWithJsonTag MapOptions = 3
)

Jump to

Keyboard shortcuts

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