Documentation ¶
Index ¶
- func Delete(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func Do(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func Get(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func JSON(req *http.Request) error
- func JSONBody(data interface{}) func(*http.Request) error
- func Method(method string) func(*http.Request) error
- func New(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Request, error)
- func NewClient(host string) (*http.Client, error)
- func Post(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
- func SockConn(timeout time.Duration, daemon string) (net.Conn, error)
- func SockRequest(method, endpoint string, data interface{}, daemon string, ...) (int, []byte, error)
- func SockRequestHijack(method, endpoint string, data io.Reader, ct string, daemon string, ...) (net.Conn, *bufio.Reader, error)
- func SockRequestRaw(method, endpoint string, data io.Reader, ct, daemon string, ...) (*http.Response, io.ReadCloser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
func Delete(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Delete creates and execute a DELETE request on the specified host and endpoint, with the specified request modifiers
func Do ¶
func Do(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Do creates and execute a request on the specified host and endpoint, with the specified request modifiers
func Get ¶
func Get(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Get creates and execute a GET request on the specified host and endpoint, with the specified request modifiers
func JSONBody ¶
JSONBody creates a modifier that encodes the specified data to a JSON string and set it as request body. It also sets the Content-Type header of the request.
func New ¶
New creates a new http Request to the specified host and endpoint, with the specified request modifiers
func Post ¶
func Post(host, endpoint string, modifiers ...func(*http.Request) error) (*http.Response, io.ReadCloser, error)
Post creates and execute a POST request on the specified host and endpoint, with the specified request modifiers
func SockRequest ¶
func SockRequest(method, endpoint string, data interface{}, daemon string, modifiers ...func(*http.Request)) (int, []byte, error)
SockRequest create a request against the specified host (with method, endpoint and other request modifier) and returns the status code, and the content as an byte slice Deprecated: use request.Do instead
func SockRequestHijack ¶
func SockRequestHijack(method, endpoint string, data io.Reader, ct string, daemon string, modifiers ...func(*http.Request)) (net.Conn, *bufio.Reader, error)
SockRequestHijack creates a connection to specified host (with method, contenttype, …) and returns a hijacked connection and the output as a `bufio.Reader`
func SockRequestRaw ¶
func SockRequestRaw(method, endpoint string, data io.Reader, ct, daemon string, modifiers ...func(*http.Request)) (*http.Response, io.ReadCloser, error)
SockRequestRaw create a request against the specified host (with method, endpoint and other request modifier) and returns the http response, the output as a io.ReadCloser Deprecated: use request.Do (or Get, Delete, Post) instead
Types ¶
This section is empty.