Releases: devfeel/mapper
Releases · devfeel/mapper
Feature: Implement variable arguments based on NewMapper for flexible configuration settings when you init mapper
Feature: Implement variable arguments based on NewMapper for flexible configuration settings when you init mapper
Latest
Version 0.7.14
- Feature: Implement variable arguments based on NewMapper for flexible configuration settings when you init mapper.
- Feature: Add Setting struct used to Config mapper
- you can use like this:
// Default Setting:
// EnabledTypeChecking: false,
// EnabledMapperStructField: true,
// EnabledAutoTypeConvert: true,
// EnabledMapperTag: true,
// EnabledJsonTag: true,
// EnabledCustomTag: false,
// EnableFieldIgnoreTag: false,
/// When you use default setting
NewMapper()
/// When you will change some setting
NewMapper(CTypeChecking(true), CCustomTagName("-"))
- 2024-09-06 19:00 in ShangHai
Full Changelog: v0.7.13...v0.7.14
Feature: Added the "composite-field" tag to mapping composite fields
Version 0.7.13
- Feature: Added the "composite-field" tag to continue expanding and searching for corresponding field mappings when encountering composite fields in a Struct. Currently, only one level of expansion is supported.
- Tips: Thanks to @naeemaei for issue #39
- For my birthday!
- you can use like this:
// Base model
type BaseModel struct {
Id int `json:"id"`
}
// Country model
type Country struct {
BaseModel `json:"composite-field"`
Name string `json:"name"`
}
- 2023-04-15 19:00 in ShangHai
BugFix: remove go mod file.
Version 0.7.10
- BugFix: remove go mod file.
- 2022-04-20 20:00 in ShangHai
add feature flag for ignore tag
Version 0.7.9
- Feature: add feature flag for ignore tag.
- Tips: about "-" we keep default behavior as previous version by default, which is use field name as key when mapping structure.
- Tips: now you can use SetEnableFieldIgnoreTag function to enable this flag right now
- 2022-04-17 21:00 in ShangHai
Refactor: use mapperObject refactored the static version implementation
Version 0.7.8
- Refactor: use mapperObject refactored the static version implementation.
- 2022-04-16 10:00 in ShangHai
thanks @devfeel
add object-oriented api for mapper
feature:
- add object-oriented API for mapper which allow users to change lots of switch dynamically by calling SetEnabledMapperTag, SetEnabledJsonTag, and so on
thanks @shyandsy
add SetEnabledMapperTag and SetEnabledJsonTag
Support for *[] to *[] and definitive error messages
Version 0.7.5
- Feature: Support for *[] to *[] with MapperSlice
- Ops: Definitive error messages
- Tips: Merge pull request #9 from MrWormHole/master, Thanks to @mrwormhole
- 2021-01-26 12:00 in ShangHai
add MapToSlice and support mapper struct to map
Version 0.7.4
- Feature: AutoMapper&Mapper support mapper struct to map[string]interface{}
- Feature: add MapToSlice to mapper from map[string]interface{} to a slice of any type's ptr
- Refactor: set MapperMapSlice to Deprecated, will remove on v1.0
- 2020-06-07 16:00 in ShangHai
MapperSlice & MapperMapSlice support ptr and struct
Version 0.7.2
- New Feature: MapperSlice support ptr and struct
- New Feature: MapperMapSlice support ptr and struct
- Detail:
- now support two slice's element type is ptr or struct in MapperSlice
- now support slice's element type is ptr or struct in MapperMapSlice
- About MapperMapSlice:
//view test code in mapper_test.go:Test_MapperSlice\Test_MapperStructSlice //type ptr var toSlice []*testStruct //type struct var toSlice []testStruct
- About MapperSlice:
//view test code in mapper_test.go:Test_MapperMapSlice\Test_MapperStructMapSlice //type ptr var fromSlice []*FromStruct var toSlice []*ToStruct //type struct var fromSlice []FromStruct var toSlice []ToStruct
- 2019-11-03 16:00 in ShangHai