Documentation ¶
Index ¶
- func BodyToObject(r *http.Request, object interface{}) error
- func ExecCmd(cmd string) (string, error)
- func Fetch(u string) (string, error)
- func FetchObject(u string, object interface{}) error
- func ResponseBodyToObject(r *http.Response, object interface{}) error
- func WriteErrorResponse(w http.ResponseWriter, code int, err error)
- func WriteResponse(w http.ResponseWriter, code int, object interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyToObject ¶
BodyToObject will convert the incoming HTTP request into the passed in 'object'
func Fetch ¶
Fetch will do an HTTP GET to the passed in URL, returning HTTP Body of the response or any error
func FetchObject ¶
FetchObject will do an HTTP GET to the passed in URL, returning the response parsed as a JSON object, or any error
func ResponseBodyToObject ¶
ResponseBodyToObject will reading the HTTP response into the passed in 'object'
func WriteErrorResponse ¶ added in v0.0.14
func WriteErrorResponse(w http.ResponseWriter, code int, err error)
WriteErrorResponse will serialize 'object' to the HTTP ResponseWriter with JSON formatted error response using the 'code' as the HTTP status code
func WriteResponse ¶
func WriteResponse(w http.ResponseWriter, code int, object interface{})
WriteResponse will serialize 'object' to the HTTP ResponseWriter using the 'code' as the HTTP status code
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.