package
0.0.0-20241226230300
Repository: https://github.com/jing-ze/oauth2-proxy.git
Documentation: pkg.go.dev
# Functions
ComposeDecodeHookFunc creates a single DecodeHookFunc that automatically composes multiple DecodeHookFuncs.
Decode takes an input structure and uses reflection to translate it to the output structure.
DecodeHookExec executes the given decode hook.
DecodeMetadata is the same as Decode, but is shorthand to enable metadata collection.
NewDecoder returns a new decoder for the given configuration.
OrComposeDecodeHookFunc executes all input hook functions until one of them returns no error.
No description provided by the author
StringToIPHookFunc returns a DecodeHookFunc that converts strings to net.IP.
StringToIPNetHookFunc returns a DecodeHookFunc that converts strings to net.IPNet.
StringToSliceHookFunc returns a DecodeHookFunc that converts string to []string by splitting on the given sep.
StringToTimeDurationHookFunc returns a DecodeHookFunc that converts strings to time.Duration.
StringToTimeHookFunc returns a DecodeHookFunc that converts strings to time.Time.
TextUnmarshallerHookFunc returns a DecodeHookFunc that applies strings to the UnmarshalText function, when the target type implements the encoding.TextUnmarshaler interface.
WeakDecode is the same as Decode but is shorthand to enable WeaklyTypedInput.
WeakDecodeMetadata is the same as Decode, but is shorthand to enable both WeaklyTypedInput and metadata collection.
WeaklyTypedHook is a DecodeHookFunc which adds support for weak typing to the decoder.
# Structs
A Decoder takes a raw interface value and turns it into structured data, keeping track of rich error information along the way in case anything goes wrong.
DecoderConfig is the configuration that is used to create a new decoder and allows customization of various aspects of decoding.
Error implements the error interface and can represents multiple errors that occur in the course of a single decode.
Metadata contains information about decoding a structure that is tedious or difficult to get otherwise.
# Interfaces
DecodeHookFunc is the callback function that can be used for data transformations.
# Type aliases
DecodeHookFuncKind is a DecodeHookFunc which knows only the Kinds of the source and target types.
DecodeHookFuncType is a DecodeHookFunc which has complete information about the source and target types.
DecodeHookFuncValue is a DecodeHookFunc which has complete access to both the source and target values.