Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPClient ¶
func WriteJSON ¶
func WriteJSON(w http.ResponseWriter, v interface{}) error
Types ¶
type Client ¶
func (*Client) NewRequest ¶
func (c *Client) NewRequest(method, url string, opts ...RequestOption) *Request
type ClientOption ¶
func WithLogger ¶
func WithLogger(logger *zerolog.Logger) ClientOption
type ErrorHandler ¶
type ErrorHandler struct {
Handler func(w http.ResponseWriter, r *http.Request) error
}
func (ErrorHandler) ServeHTTP ¶
func (h ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP allows our Handler type to satisfy http.Handler.
type Request ¶
type RequestOption ¶
type RequestOption func(*RequestSettings)
func WithBackoff ¶
func WithBackoff(backoff retryablehttp.Backoff) RequestOption
func WithCheckRetry ¶
func WithCheckRetry(checkRetry retryablehttp.CheckRetry) RequestOption
func WithRetryMax ¶
func WithRetryMax(max int) RequestOption
func WithRetryWaitMax ¶
func WithRetryWaitMax(d time.Duration) RequestOption
func WithRetryWaitMin ¶
func WithRetryWaitMin(d time.Duration) RequestOption
type RequestSettings ¶
type RequestSettings struct { RetryWaitMin time.Duration RetryWaitMax time.Duration RetryMax int CheckRetry retryablehttp.CheckRetry Backoff retryablehttp.Backoff }
type StatusError ¶
func (StatusError) Error ¶
func (se StatusError) Error() string
func (StatusError) Status ¶
func (se StatusError) Status() int
Click to show internal directories.
Click to hide internal directories.