Documentation
¶
Overview ¶
Package jsomfmt provides json format for file reading and http requests
Index ¶
- func Decode(r *http.Request, val interface{}) error
- func InputFile(jsonFileName string, val interface{}) error
- func Output(w io.Writer, val interface{}) error
- func Respond(ctx context.Context, w http.ResponseWriter, data interface{}, statusCode int) error
- func RespondError(ctx context.Context, w http.ResponseWriter, err error) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode reads the body of an HTTP request looking for a JSON document. The body is decoded into the provided value.
If the provided value is a struct then it is checked for validation tags.
func RespondError ¶
RespondError sends an error reponse back to the cli.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.