Discover Packages
github.com/retgits/gh
util
package
Version:
v1.2.0
Opens a new window with list of versions in this module.
Published: Sep 24, 2018
License: MIT
Opens a new window with license information.
Imports: 6
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package util implements utility methods
Package util implements utility methods
func WriteFile(filename string, content string) error
type HTTPResponse
func HTTPGet(URL string, encoding string, header http.Header) (HTTPResponse, error)
func HTTPPatch(URL string, encoding string, postData string, header http.Header) (HTTPResponse, error)
func HTTPPost(URL string, encoding string, postData string, header http.Header) (HTTPResponse, error)
WriteFile writes the content, passed in as a parameter, to a file, which is also passed in as a parameter. It tries to create the file if it doesn't exist and will return errors when one occurs.
type HTTPResponse struct {
Body map[string ]interface{}
StatusCode int
}
HTTPResponse is the response type for the HTTP requests
HTTPGet executes a GET request to a URL and returns the response body as a JSON object
HTTPPatch executes a PATCH request to a URL and returns the response body as a JSON object
HTTPPost executes a POST request to a URL and returns the response body as a JSON object
Source Files
¶
Click to show internal directories.
Click to hide internal directories.