Documentation
¶
Overview ¶
Package utils implements generic utilities for api
Package utils implements generic utilities for api
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendHTTPError ¶
func SendHTTPError(status int, err error, w http.ResponseWriter)
SendHTTPError sends http error to client
func SendHTTPResponse ¶
func SendHTTPResponse(data interface{}, status int, w http.ResponseWriter)
SendHTTPResponse sends http response to client
Types ¶
type HTTPResponse ¶
type HTTPResponse struct {
Status int `json:"status"`
Data interface{} `json:"data"`
}
HTTPResponse struct defines fields for http error
Click to show internal directories.
Click to hide internal directories.