Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DefaultTimeout = 10 * time.Second
)
Functions ¶
This section is empty.
Types ¶
type HttpRequestor ¶
type HttpRequestor struct {
// contains filtered or unexported fields
}
HttpRequestor implements the Requestor interface
func (*HttpRequestor) DoRequest ¶
func (r *HttpRequestor) DoRequest(ctx context.Context, method, url string, options RequestOptions) (RequestResponse, error)
DoRequest executes and parsed the response of an http request The context passed in will be used for request timeouts, UNLESS there is no timeout set, at which point the default will be used.
type RequestOptions ¶
RequestOptions is the data to configure an http request sent by a Requestor
type RequestResponse ¶
RequestResponse is the data returned by a Requestor
type Requestor ¶
type Requestor interface {
DoRequest(ctx context.Context, method, url string, options RequestOptions) (RequestResponse, error)
}
Requestor is an interface for making http requests
func NewRequestor ¶
NewRequestor returns a Requestor with a default client if one is not passed
Click to show internal directories.
Click to hide internal directories.