Skip to content

Releases: devfeel/mapper

Feature: Implement variable arguments based on NewMapper for flexible configuration settings when you init mapper

06 Sep 02:32
Compare
Choose a tag to compare

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

15 Apr 11:25
Compare
Choose a tag to compare

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.

20 Apr 12:17
f14f3f9
Compare
Choose a tag to compare

Version 0.7.10

  • BugFix: remove go mod file.
  • 2022-04-20 20:00 in ShangHai

add feature flag for ignore tag

20 Apr 11:58
e0c28cc
Compare
Choose a tag to compare

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

16 Apr 06:07
4a27752
Compare
Choose a tag to compare

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

15 Apr 16:05
28d634f
Compare
Choose a tag to compare
Pre-release

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

15 Apr 05:43
afed01d
Compare
Choose a tag to compare

Version 0.7.6

  • Feature: add SetEnabledMapperTag to set enabled flag for 'Mapper' tag check
  • Feature: add SetEnabledJsonTag to set enabled flag for 'Json' tag check
  • Ops: add some test cases
  • Tips: Thanks to @aeramu for issue #12
  • 2021-10-19 12:00 in ShangHai

Support for *[] to *[] and definitive error messages

26 Jan 05:33
Compare
Choose a tag to compare

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

07 Jun 01:50
Compare
Choose a tag to compare

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

03 Nov 09:05
Compare
Choose a tag to compare

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