Documentation ¶
Index ¶
- Constants
- func Code(err error) int
- func StatusCode(err error) int
- type Client
- type ClientOption
- type Request
- type RequestOption
- func WithBody(v interface{}) RequestOption
- func WithContext(ctx context.Context) RequestOption
- func WithForm(v interface{}) RequestOption
- func WithHeader(header map[string]string) RequestOption
- func WithHost(host string) RequestOption
- func WithJSON(v interface{}) RequestOption
- func WithMethod(method string) RequestOption
- func WithPath(path string) RequestOption
- func WithQuery(query url.Values) RequestOption
- func WithRequestLogger(w io.Writer) RequestOption
- func WithRequestTrace(ctx context.Context) RequestOption
- func WithResponseLogger(w io.Writer) RequestOption
- func WithURL(url string) RequestOption
- func WithXML(v interface{}) RequestOption
- type RequestValidatorFunc
- type Response
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func StatusCode ¶ added in v1.0.7
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
type ClientOption ¶
type ClientOption func(*Client)
func WithDefaultOptions ¶
func WithDefaultOptions(opts ...RequestOption) ClientOption
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
func WithRequestValidation ¶
func WithRequestValidation(fn RequestValidatorFunc) ClientOption
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest(opts ...RequestOption) (*Request, error)
type RequestOption ¶
func WithBody ¶
func WithBody(v interface{}) RequestOption
func WithContext ¶ added in v1.0.10
func WithContext(ctx context.Context) RequestOption
func WithForm ¶
func WithForm(v interface{}) RequestOption
func WithHeader ¶
func WithHeader(header map[string]string) RequestOption
func WithHost ¶
func WithHost(host string) RequestOption
func WithJSON ¶
func WithJSON(v interface{}) RequestOption
func WithMethod ¶
func WithMethod(method string) RequestOption
func WithPath ¶
func WithPath(path string) RequestOption
func WithQuery ¶
func WithQuery(query url.Values) RequestOption
func WithRequestLogger ¶ added in v1.0.10
func WithRequestLogger(w io.Writer) RequestOption
func WithRequestTrace ¶ added in v1.1.0
func WithRequestTrace(ctx context.Context) RequestOption
WithRequestTrace returns a RequestOption that will trace the request using datadog. Side Effect: adds context to request
func WithResponseLogger ¶ added in v1.0.10
func WithResponseLogger(w io.Writer) RequestOption
func WithURL ¶
func WithURL(url string) RequestOption
func WithXML ¶
func WithXML(v interface{}) RequestOption
type RequestValidatorFunc ¶
Click to show internal directories.
Click to hide internal directories.