Documentation
¶
Overview ¶
Package mapify converts structs (and other maps) into maps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
Element represents either a map entry, field of a struct or unnamed element of a slice.
func (Element) Name ¶
Name returns field name of a struct, key of a map or empty string, when it represents element of a slice.
func (Element) StructField ¶ added in v0.3.0
func (e Element) StructField() (_ reflect.StructField, ok bool)
StructField returns the reflect.StructField if e represents a field of a struct. If not, ok is false.
type Filter ¶
Filter returns true when element should be included. If error is returned then the whole conversion is aborted and wrapped error is returned from Mapper.MapAny method.
type MapValue ¶
MapValue maps (transforms) element value. If error is returned then the whole conversion is aborted and wrapped error is returned from Mapper.MapAny method.
type Mapper ¶ added in v0.2.0
type Mapper struct { ShouldConvert ShouldConvert Filter Filter Rename Rename MapValue MapValue }
Mapper represents instance of mapper