Documentation
¶
Index ¶
Constants ¶
View Source
const PKG_VERSION = "v2.1.0"
Variables ¶
This section is empty.
Functions ¶
func HandleRecovered ¶
HandleRecovered logs a recovered panic
Types ¶
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
HTTPClient represents the HTTPClient infos
func NewHTTPClient ¶
func NewHTTPClient(baseURL string, options HTTPOptions) *HTTPClient
NewHTTPClient creates an HTTP requester object
func (*HTTPClient) Call ¶
func (r *HTTPClient) Call(path, method string, body []byte, headers map[string]string) (*HTTPResponse, error)
Call executes request with retries and returns response body, headers, status code and error
type HTTPClientInterface ¶ added in v2.1.0
type HTTPClientInterface interface {
Call(path, method string, body []byte, headers map[string]string) (*HTTPResponse, error)
}
HTTPClientInterface represents an interface for HTTP caller
func NewHTTPClientMock ¶ added in v2.1.0
func NewHTTPClientMock(responseCode int, responseBody []byte, responseHeaders http.Header) HTTPClientInterface
NewHTTPClientMock creates an HTTP mock object
type HTTPClientMock ¶ added in v2.1.0
type HTTPClientMock struct {
// contains filtered or unexported fields
}
HTTPClientMock represents the HTTPClientMock infos
func (*HTTPClientMock) Call ¶ added in v2.1.0
func (r *HTTPClientMock) Call(path, method string, body []byte, headers map[string]string) (*HTTPResponse, error)
Call executes request with retries and returns response body, headers, status code and error
type HTTPOptions ¶
HTTPOptions represents the options for the HTTPRequest object
Click to show internal directories.
Click to hide internal directories.