Documentation
¶
Index ¶
- func BodyToObject(r *http.Request, object interface{}) error
- func ExecCmd(cmd string) (string, error)
- func Fetch(u string) (string, error)
- func FetchChartToFile(chart string, f *os.File) error
- func FetchObject(u string, object interface{}) error
- func ResponseBodyToObject(r *http.Response, object interface{}) error
- func WriteResponse(w http.ResponseWriter, code int, object interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BodyToObject ¶
func BodyToObject(r *http.Request, object interface{}) error
BodyToObject will convert the incoming HTTP request into the passed in 'object'
func ExecCmd ¶
func ExecCmd(cmd string) (string, error)
ExecCmd executes a command and returns the stdout + error, if any
func Fetch ¶
func Fetch(u string) (string, error)
Fetch will do an HTTP GET to the passed in URL, returning HTTP Body of the response or any error
func FetchChartToFile ¶
func FetchChartToFile(chart string, f *os.File) error
FetchChartToFile fetches the given chart to an opened file. File will be closed in any case.
func FetchObject ¶
func FetchObject(u string, object interface{}) error
FetchObject will do an HTTP GET to the passed in URL, returning the response parsed as a JSON object, or any error
func ResponseBodyToObject ¶
func ResponseBodyToObject(r *http.Response, object interface{}) error
ResponseBodyToObject will reading the HTTP response into the passed in 'object'
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.