Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Serializer ¶
type Serializer interface { Encode(w http.ResponseWriter, status int, headers ...http.Header) error Decode(w http.ResponseWriter, r *http.Request, data any) error ErrorJson(w http.ResponseWriter, err error, status ...int) error }
Serializer provides an interface to read and write JSON data passed between server and client.
func NewSerializer ¶
func NewSerializer(err bool, msg string, data any) Serializer
NewSerializer instantiates a new serializer struct to carry out encoding/decoding.
Click to show internal directories.
Click to hide internal directories.