Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Map ¶
Map converts any variable `value` to map[string]any. If the parameter `value` is not a map/struct/*struct type, then the conversion will fail and returns nil.
If `value` is a struct/*struct object, the second parameter `priorityTagAndFieldName` specifies the most priority priorityTagAndFieldName that will be detected, otherwise it detects the priorityTagAndFieldName in order of: gconv, json, field name.
func Struct ¶
Struct maps the params key-value pairs to the corresponding struct object's attributes. The third parameter `mapping` is unnecessary, indicating the mapping rules between the custom key name and the attribute name(case-sensitive).
Note:
- The `params` can be any type of map/struct, usually a map.
- The `pointer` should be type of *struct/**struct, which is a pointer to struct object or struct pointer.
- Only the public attributes of struct object can be mapped.
- If `params` is a map, the key of the map `params` can be lowercase. It will automatically convert the first letter of the key to uppercase in mapping procedure to do the matching. It ignores the map key, if it does not match.
Types ¶
Click to show internal directories.
Click to hide internal directories.