Documentation ¶
Index ¶
- func GetHeaderParam(r *http.Request, key string) string
- func GetQueryParam(r *http.Request, key string) string
- func GetURLParam(r *http.Request, key string) string
- func SendHTTPResponse(w http.ResponseWriter, httpStatus int, responses ...interface{})
- func SetHeaders(w http.ResponseWriter, headerMap http.Header)
- type HTTPResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendHTTPResponse ¶
func SendHTTPResponse(w http.ResponseWriter, httpStatus int, responses ...interface{})
SendHTTPResponse sends the http response to the client
func SetHeaders ¶
func SetHeaders(w http.ResponseWriter, headerMap http.Header)
SetHeaders sets the headers in response
Types ¶
type HTTPResult ¶
HTTPResult is the result return by the library
func DoHTTPRequest ¶
func DoHTTPRequest(ctx context.Context, client *http.Client, method string, urlString string, body interface{}, required []string, okResponse interface{}, errorResponse interface{}) (*HTTPResult, error)
DoHTTPRequest returns HTTPResult
func (*HTTPResult) Error ¶
func (r *HTTPResult) Error() string
Click to show internal directories.
Click to hide internal directories.