Documentation ¶
Index ¶
- func AddMapper(mapper *EntityMapper)
- func AddMappers(mappers ...*EntityMapper)
- func Map(from interface{}, to interface{}, options ...MapFunc) (interface{}, error)
- func MapProp(from interface{}, to interface{}, options ...MapFunc) error
- func MapSlice(from interface{}, to interface{}, options ...MapFunc) (interface{}, error)
- func MustMap(from interface{}, to interface{}, options ...MapFunc) interface{}
- func MustMapProp(from interface{}, to interface{}, options ...MapFunc)
- func MustMapSlice(from interface{}, to interface{}, options ...MapFunc) interface{}
- type EntityMapper
- type EntityMappers
- func (e *EntityMappers) AddMapper(m *EntityMapper)
- func (e *EntityMappers) AddMappers(ms ...*EntityMapper)
- func (e *EntityMappers) GetMapper(from interface{}, to interface{}) (*EntityMapper, error)
- func (e *EntityMappers) Map(from interface{}, toModel interface{}, options ...MapFunc) (interface{}, error)
- func (e *EntityMappers) MapProp(from interface{}, to interface{}, options ...MapFunc) error
- func (e *EntityMappers) MapSlice(fromInterface interface{}, toModel interface{}, options ...MapFunc) (interface{}, error)
- func (e *EntityMappers) MustMap(from interface{}, toModel interface{}, options ...MapFunc) interface{}
- func (e *EntityMappers) MustMapProp(from interface{}, to interface{}, options ...MapFunc)
- func (e *EntityMappers) MustMapSlice(from interface{}, toModel interface{}, options ...MapFunc) interface{}
- type MapFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddMapper ¶
func AddMapper(mapper *EntityMapper)
AddMapper adds an EntityMapper to EntityMappers.
func AddMappers ¶
func AddMappers(mappers ...*EntityMapper)
AddMappers adds some EntityMapper to EntityMappers.
func MustMap ¶
func MustMap(from interface{}, to interface{}, options ...MapFunc) interface{}
Map is the must version of MapProp, panic if error.
func MustMapProp ¶
func MustMapProp(from interface{}, to interface{}, options ...MapFunc)
MustMapProp is the must version of MapProp, panic if error.
func MustMapSlice ¶
func MustMapSlice(from interface{}, to interface{}, options ...MapFunc) interface{}
MapSlice is the must version of MapProp, panic if error.
Types ¶
type EntityMapper ¶
type EntityMapper struct {
// contains filtered or unexported fields
}
EntityMapper represents an entity mapper.
func GetMapper ¶
func GetMapper(from interface{}, to interface{}) (*EntityMapper, error)
GetMapper returns the EntityMapper from EntityMappers.
func NewMapper ¶
func NewMapper(from interface{}, ctor func() interface{}, mapFunc MapFunc) *EntityMapper
NewMapper creates a EntityMapper.
func (*EntityMapper) GetMapFunc ¶ added in v1.4.3
func (e *EntityMapper) GetMapFunc() MapFunc
GetMapFunc returns the MapFunc from EntityMapper.
type EntityMappers ¶
type EntityMappers struct {
// contains filtered or unexported fields
}
EntityMappers represents an entity mappers container.
func (*EntityMappers) AddMapper ¶
func (e *EntityMappers) AddMapper(m *EntityMapper)
AddMapper adds an EntityMapper to EntityMappers.
func (*EntityMappers) AddMappers ¶
func (e *EntityMappers) AddMappers(ms ...*EntityMapper)
AddMappers adds some EntityMapper to EntityMappers.
func (*EntityMappers) GetMapper ¶
func (e *EntityMappers) GetMapper(from interface{}, to interface{}) (*EntityMapper, error)
GetMapper returns the EntityMapper from EntityMappers.
func (*EntityMappers) Map ¶
func (e *EntityMappers) Map(from interface{}, toModel interface{}, options ...MapFunc) (interface{}, error)
Map generates a `to` from `from`.
func (*EntityMappers) MapProp ¶
func (e *EntityMappers) MapProp(from interface{}, to interface{}, options ...MapFunc) error
MapProp maps properties from `from` to `to`.
func (*EntityMappers) MapSlice ¶
func (e *EntityMappers) MapSlice(fromInterface interface{}, toModel interface{}, options ...MapFunc) (interface{}, error)
MapSlice generates a `to` slice from `from` slice.
func (*EntityMappers) MustMap ¶
func (e *EntityMappers) MustMap(from interface{}, toModel interface{}, options ...MapFunc) interface{}
Map is the must version of MapProp, panic if error.
func (*EntityMappers) MustMapProp ¶
func (e *EntityMappers) MustMapProp(from interface{}, to interface{}, options ...MapFunc)
MustMapProp is the must version of MapProp, panic if error.
func (*EntityMappers) MustMapSlice ¶
func (e *EntityMappers) MustMapSlice(from interface{}, toModel interface{}, options ...MapFunc) interface{}
MapSlice is the must version of MapProp, panic if error.