Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is an HTTP client
func (*Client) Get ¶
func (c *Client) Get(url string, opts ...RequestOpt) (*HTTPResponse, error)
Get put an HTTP GET request
func (*Client) Post ¶
func (c *Client) Post(url string, req []byte, opts ...RequestOpt) (*HTTPResponse, error)
Post posts an HTTP request
type HTTPResponse ¶
HTTPResponse contains an HTTP response
type Opt ¶
type Opt func(c *Client)
Opt defines an option for the HTTP client
func WithTransport ¶
func WithTransport(rt http.RoundTripper) Opt
WithTransport sets the transport for the client. This is usually only set for unit tests.
type RequestOpt ¶
type RequestOpt func(opts *requestOptions)
RequestOpt sets a request option
func WithAuthToken ¶
func WithAuthToken(token string) RequestOpt
WithAuthToken sets an authorization token in the header
Click to show internal directories.
Click to hide internal directories.