Documentation
¶
Overview ¶
Package json provides utility functions for handling JSON encoding and decoding in HTTP requests and responses.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadJSON ¶
ReadJSON reads and decodes JSON from the request body into the provided destination struct. It also performs various checks and returns detailed error messages for different types of JSON decoding errors.
func ReadUUIDPath ¶
ReadUUIDPath extracts and parses a UUID from the request path, returning an error if the UUID is invalid.
func RespondWithJSON ¶
func RespondWithJSON(w http.ResponseWriter, code int, payload interface{})
RespondWithJSON encodes the given payload to JSON and writes it to the response writer with the specified HTTP status code.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.