Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MapFunc ¶
type MapFunc func(inKey string, inVal interface{}) (mt MappingType, outKey string, outVal interface{})
MapFunc used to map a field name and value to another field name and value
type Mapper ¶
type Mapper struct { // MapFunc maps keys and values to some other key or value MapFunc MapFunc // CaseSensitive if MapToStruct should be case-sensitive CaseSensitive bool }
Mapper used for mapping structs to maps or other structs
func (*Mapper) MapToStruct ¶
MapToStruct takes a map or a struct ptr (as fromPtr) and maps to a struct ptr
func (*Mapper) StructToMap ¶
StructToMap maps a struct pointer to a map. Including nested structs
type MappingType ¶
type MappingType int
MappingType the type of mapping to perform
const ( // Default use the default mapping logic provided Default MappingType = iota // Custom force the key to be a value Custom // Ignore ignores the field entirely Ignore )
func NilMapFunc ¶
func NilMapFunc(inKey string, inVal interface{}) (mt MappingType, outKey string, outVal interface{})
NilMapFunc default mapper that returns the same field name and value
func (MappingType) String ¶
func (t MappingType) String() string
Click to show internal directories.
Click to hide internal directories.