Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppLogger ¶
func NewAppLogger ¶
type HttpHandlerJson ¶ added in v0.0.2
type HttpHandlerJson struct{}
func NewHttpHandler ¶ added in v0.0.2
func NewHttpHandler() *HttpHandlerJson
func (*HttpHandlerJson) ErrorJSON ¶ added in v0.0.2
func (h *HttpHandlerJson) ErrorJSON(w http.ResponseWriter, err error, status ...int) error
ErrorJSON takes an error, and optionally a response status code, and generates and sends a json error response
func (*HttpHandlerJson) ReadJSON ¶ added in v0.0.2
func (h *HttpHandlerJson) ReadJSON(w http.ResponseWriter, r *http.Request, data any) error
ReadJSON tries to read the body of a request and converts it into JSON
func (*HttpHandlerJson) WriteJSON ¶ added in v0.0.2
func (h *HttpHandlerJson) WriteJSON(w http.ResponseWriter, status int, data any, headers ...http.Header) error
WriteJSON takes a response status code and arbitrary data and writes a json response to the client
Click to show internal directories.
Click to hide internal directories.