Documentation ¶
Overview ¶
Package json provides helper methods to read (both filtered and unfiltered) and write JSON request bodies.
json.Read(r, &user) json.ReadFiltered(r, &user, []string{"name"}) json.Write(rw, &user)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Read ¶
Read reads the JSON body of the given context and decodes it into the provided data structure.
func ReadFiltered ¶
Read allows to read a JSON request body into a struct while filtering the read JSON properties by the provided whitelist.
func Write ¶
func Write(rw http.ResponseWriter, data interface{})
Write marshals the given data and writes it to the provided context.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.