Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct{}
Decoder struct
func NewDecoder ¶
func NewDecoder() *Decoder
NewDecoder creates a new JSON decoder
Returns:
- *Decoder: The default decoder
type StreamDecoder ¶
type StreamDecoder struct{}
StreamDecoder is the JSON decoder struct
func NewStreamDecoder ¶
func NewStreamDecoder() *StreamDecoder
NewStreamDecoder creates a new JSON decoder
Returns:
- *StreamDecoder: The default decoder
func (StreamDecoder) Decode ¶
func (s StreamDecoder) Decode( body any, dest any, ) error
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 (StreamDecoder) DecodeReader ¶
func (s StreamDecoder) DecodeReader( reader io.Reader, dest any, ) error
DecodeReader decodes a JSON body from a reader into a destination
Parameters:
- reader: The reader to read the body from
- dest: The destination to store the decoded body
Returns:
- error: The error if any
Click to show internal directories.
Click to hide internal directories.