Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶ added in v0.11.2
type Decoder struct {
// contains filtered or unexported fields
}
Decoder struct
func NewDecoder ¶ added in v0.11.2
func NewDecoder( mode *goflagsmode.Flag, decoder gojsondecoder.Decoder, ) (*Decoder, error)
NewDecoder creates a new JSON decoder
Parameters:
- mode: The flag mode
- decoder: The JSON decoder
Returns:
- *Decoder: The default decoder
- error: The error if any
func (Decoder) Decode ¶ added in v0.11.2
Decode decodes the JSON body from an any value and stores it in the destination
Parameters:
- body: The body to decode
- dest: The destination to store the decoded body
Returns:
- error: The error if any
func (Decoder) DecodeReader ¶ added in v0.12.2
DecodeReader decodes the JSON body and stores it in the destination
Parameters:
- reader: The reader to read the body from
- dest: The destination to store the decoded body
Returns:
- error: The error if any
func (Decoder) DecodeRequest ¶ added in v0.12.2
DecodeRequest decodes the JSON request body and stores it in the destination
Parameters:
- request: The HTTP request
- dest: The destination to store the decoded body
Returns:
- error: The error if any
Click to show internal directories.
Click to hide internal directories.