Documentation ¶
Index ¶
- Constants
- func BinaryUnmarshalerHookFunc() mapstructure.DecodeHookFuncType
- func DecodeQuery(query string, dst interface{}, config *mapstructure.DecoderConfig, ...) error
- func DecodeURLValues(u url.Values, dst interface{}, config *mapstructure.DecoderConfig, ...) error
- func DefaultDecodeHookFuncs() []mapstructure.DecodeHookFunc
- func JSON[sT any, dT any](src sT, dst *dT) error
- func StringToBaseTypeHookFunc(fv reflect.Value, tv reflect.Value) (interface{}, error)
- func StringToTimeHookFunc(f reflect.Type, t reflect.Type, data interface{}) (interface{}, error)
- func URLValuesHookFunc(fc mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc
- type Time
Constants ¶
View Source
const ( TimeFormatUnixTimestamp = "unix-timestamp" TimeFormatUnixMilliTimestamp = "unix-milli-timestamp" TimeFormatUnixTimestampString = "unix-timestamp-string" TimeFormatUnixMilliTimestampString = "unix-milli-timestamp-string" TimeFormatFloatUnixTimestamp = "float-unix-timestamp" TimeFormatFloatUnixMilliTimestamp = "float-unix-milli-timestamp" TimeFormatFloatUnixTimestampString = "float-unix-timestamp-string" TimeFormatFloatUnixMilliTimestampString = "float-unix-milli-timestamp-string" )
Variables ¶
This section is empty.
Functions ¶
func BinaryUnmarshalerHookFunc ¶ added in v1.2.3
func BinaryUnmarshalerHookFunc() mapstructure.DecodeHookFuncType
BinaryUnmarshalerHookFunc returns a DecodeHookFunc that applies strings to the UnmarshalBinary function, when the target type implements the encoding.BinaryUnmarshaler interface
func DecodeQuery ¶ added in v1.2.3
func DecodeQuery(query string, dst interface{}, config *mapstructure.DecoderConfig, fs ...mapstructure.DecodeHookFunc) error
DecodeQuery takes an input query string and uses reflection to translate it to the dst structure. dst must be a pointer to a map or struct.
func DecodeURLValues ¶ added in v1.2.3
func DecodeURLValues(u url.Values, dst interface{}, config *mapstructure.DecoderConfig, fs ...mapstructure.DecodeHookFunc) error
DecodeURLValues takes an input url.Values and uses reflection to translate it to the dst structure. dst must be a pointer to a map or struct.
func DefaultDecodeHookFuncs ¶ added in v1.2.3
func DefaultDecodeHookFuncs() []mapstructure.DecodeHookFunc
func StringToBaseTypeHookFunc ¶ added in v1.2.3
func StringToTimeHookFunc ¶ added in v1.2.3
StringToTimeHookFunc returns a DecodeHookFunc that converts strings to time.Time.
func URLValuesHookFunc ¶ added in v1.2.3
func URLValuesHookFunc(fc mapstructure.DecodeHookFunc) mapstructure.DecodeHookFunc
Types ¶
Click to show internal directories.
Click to hide internal directories.