Documentation ¶
Index ¶
- type Client
- func NewHTTPClient(url string) *Client
- func NewHTTPClientWithTimeout(url string, timeout time.Duration) *Client
- func NewHTTPClientWithTimeoutAndRedirectPolicy(url string, timeout time.Duration, ...) *Client
- func NewHTTPSClient(url string, transport http.RoundTripper) *Client
- func NewHTTPSClientWithTimeout(url string, transport http.RoundTripper, timeout time.Duration) *Client
- func NewHTTPSClientWithTimeoutAndRedirectPolicy(url string, transport http.RoundTripper, timeout time.Duration, ...) *Client
- func NewSocketClient(filename string) *Client
- func NewSocketClientWithTimeout(filename string, timeout time.Duration) *Client
- type Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is a simple wrapper for http.Client
func NewHTTPClient ¶
NewHTTPClient returns a client that communicates over ip using a 30 second timeout
func NewHTTPClientWithTimeout ¶
NewHTTPClientWithTimeout returns a client that communicates over ip
func NewHTTPClientWithTimeoutAndRedirectPolicy ¶
func NewHTTPClientWithTimeoutAndRedirectPolicy(url string, timeout time.Duration, redirectPolicyFunc func(*http.Request, []*http.Request) error) *Client
NewHTTPClientWithTimeoutAndRedirectPolicy returns a client that communicates over ip. The redirectPoliyFunc to handle the redirect behaviors on the headers before forwarding.
func NewHTTPSClient ¶
func NewHTTPSClient(url string, transport http.RoundTripper) *Client
NewHTTPSClient returns a new https client
func NewHTTPSClientWithTimeout ¶
func NewHTTPSClientWithTimeout(url string, transport http.RoundTripper, timeout time.Duration) *Client
NewHTTPSClientWithTimeout returns a client that communicates over ip with tls :
func NewHTTPSClientWithTimeoutAndRedirectPolicy ¶
func NewHTTPSClientWithTimeoutAndRedirectPolicy(url string, transport http.RoundTripper, timeout time.Duration, redirectPolicyFunc func(*http.Request, []*http.Request) error) *Client
NewHTTPSClientWithTimeoutAndRedirectPolicy returns a client that communicates over ip
func NewSocketClient ¶
NewSocketClient returns a client that communicates over a unix socket using a 30 second connect timeout
func NewSocketClientWithTimeout ¶
NewSocketClientWithTimeout returns a client that communicates over a unix file socket
type Request ¶
type Request struct { //Action to take, ie: GET, POST, PUT, PATCH, DELETE Action string //Path is the URI Path string //Header to include one or more headers in the request Header map[string]string //Payload to send (may be nil) Payload interface{} //Response to marshal into (may be nil) Response interface{} //ResponseError to marshal error into (may be nil) ResponseError interface{} }
Request encapsulates a request to the Do* family of functions