Documentation
¶
Index ¶
- Variables
- func DateTimeDecodeHook(layout string, location *time.Location) mapstructure.DecodeHookFuncType
- func Filter(src []map[string]interface{}, fields []string)
- func GetStructTagNames(val any, tag string) []string
- func JSONNumberDecodeHook(srcT, dstT reflect.Type, data interface{}) (interface{}, error)
- func Remap(src []map[string]interface{}, fieldMap []FieldRemap) error
- type DateTime
- type FieldRemap
- type URL
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DateTimeDecodeHook ¶
func DateTimeDecodeHook(layout string, location *time.Location) mapstructure.DecodeHookFuncType
DateTimeDecodeHook parses date time that's supplied in a non-standard layout if layout does not contain a time zone, a location need be provided
func GetStructTagNames ¶
GetStructTags returns list of names for a given struct tag
func JSONNumberDecodeHook ¶
JSONNumberDecodeHook helps mapstructure to deal with
func Remap ¶
func Remap(src []map[string]interface{}, fieldMap []FieldRemap) error
Remap is used to rename map keys in-place
Types ¶
type DateTime ¶
type DateTime struct {
// contains filtered or unexported fields
}
DateTime is used by some API services to represent date and/or time in a non-standard manners, that may also be
func NewDateTime ¶
NewDateTime creates new date time object
func (DateTime) MarshalJSON ¶
MarshalJSON implements json.Marshaler
type FieldRemap ¶
type FieldRemap struct {
From, To string
}
func NewRemapFromPairs ¶
func NewRemapFromPairs(src []string) ([]FieldRemap, error)
NewRemapFromPairs takes an array of srcKey=dstKey pairs and converts them into FieldRemap array
Click to show internal directories.
Click to hide internal directories.