Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type Client ¶
type Client interface {
Get(u *url.URL, opts ...RequestOpts) (Response, error)
Post(u *url.URL, payload io.Reader, opts ...RequestOpts) (Response, error)
}
Client is inteface class for HTTP client.
type ClientOpts ¶
type ClientOpts func(*client)
func WithHTTPClient ¶
func WithHTTPClient(cli *http.Client) ClientOpts
WithProtocol returns function for setting http.Client.
type RequestOpts ¶
func WithContext ¶
func WithContext(ctx context.Context) RequestOpts
WithProtocol returns function for setting context.Context.
func WithRequestHeaderAdd ¶
func WithRequestHeaderAdd(name, value string) RequestOpts
WithRequestHeaderAdd returns function for adding request header in http.Request.
func WithRequestHeaderSet ¶
func WithRequestHeaderSet(name, value string) RequestOpts
WithRequestHeaderSet returns function for setting request header in http.Request.
Click to show internal directories.
Click to hide internal directories.
