Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGenericTypeConverterPair ¶
func NewGenericTypeConverterPair[A interface{}, B interface{}](
srcType A,
dstType B,
fromFn func(src A) B,
toFn func(src B) A,
) []copier.TypeConverter
Types ¶
type CopierMapper ¶
func NewCopierMapper ¶
func NewCopierMapper[DTO any, ENTITY any]() *CopierMapper[DTO, ENTITY]
func (*CopierMapper[DTO, ENTITY]) AppendConverter ¶
func (m *CopierMapper[DTO, ENTITY]) AppendConverter(converter copier.TypeConverter)
func (*CopierMapper[DTO, ENTITY]) AppendConverters ¶
func (m *CopierMapper[DTO, ENTITY]) AppendConverters(converters []copier.TypeConverter)
func (*CopierMapper[DTO, ENTITY]) ToDTO ¶
func (m *CopierMapper[DTO, ENTITY]) ToDTO(entity *ENTITY) *DTO
func (*CopierMapper[DTO, ENTITY]) ToEntity ¶
func (m *CopierMapper[DTO, ENTITY]) ToEntity(dto *DTO) *ENTITY
type EnumTypeConverter ¶
type EnumTypeConverter[DTO ~int32, ENTITY ~string] struct { // contains filtered or unexported fields }
func NewEnumTypeConverter ¶
func (*EnumTypeConverter[DTO, ENTITY]) NewConverterPair ¶
func (m *EnumTypeConverter[DTO, ENTITY]) NewConverterPair() []copier.TypeConverter
func (*EnumTypeConverter[DTO, ENTITY]) ToDTO ¶
func (m *EnumTypeConverter[DTO, ENTITY]) ToDTO(entity *ENTITY) *DTO
func (*EnumTypeConverter[DTO, ENTITY]) ToEntity ¶
func (m *EnumTypeConverter[DTO, ENTITY]) ToEntity(dto *DTO) *ENTITY
type Mapper ¶
type Mapper[DTO any, ENTITY any] interface { // ToEntity converts a DTO to a Database Entity. ToEntity(*DTO) *ENTITY // ToDTO converts a Database Entity to a DTO. ToDTO(*ENTITY) *DTO }
Mapper defines the interface for converting between Data Transfer Objects (DTOs) and Database Entities.
Click to show internal directories.
Click to hide internal directories.