Documentation ¶
Index ¶
- Variables
- type Caller
- func (c *Caller) Connect(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Delete(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Do(ctx context.Context, method, url string, opts ...RequestFunc) Result
- func (c *Caller) Get(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Head(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Options(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Patch(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Post(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Put(ctx context.Context, url string, opts ...RequestFunc) Result
- func (c *Caller) Trace(ctx context.Context, url string, opts ...RequestFunc) Result
- type Core
- type NoRetryError
- type Option
- func WithConnTimeout(timeout time.Duration) Option
- func WithCookieJar(cookiejar http.CookieJar) Option
- func WithKeepAlive(alive time.Duration) Option
- func WithMaxIdleConn(conn int) Option
- func WithParseFunc(parseFunc ParseFunc) Option
- func WithProxy(proxy func(*http.Request) (*url.URL, error)) Option
- func WithProxyURL(proxyURL string) Option
- func WithReadBuffer(buffer int) Option
- func WithRedirect(redirect func(req *http.Request, via []*http.Request) error) Option
- func WithRetry(retries int, internal time.Duration) Option
- func WithTimeout(timeout time.Duration) Option
- func WithWriteBuffer(buffer int) Option
- type ParseFunc
- type RequestFunc
- type Result
- func Connect(ctx context.Context, url string, opts ...RequestFunc) Result
- func Delete(ctx context.Context, url string, opts ...RequestFunc) Result
- func Get(ctx context.Context, url string, opts ...RequestFunc) Result
- func Head(ctx context.Context, url string, opts ...RequestFunc) Result
- func Options(ctx context.Context, url string, opts ...RequestFunc) Result
- func Patch(ctx context.Context, url string, opts ...RequestFunc) Result
- func Post(ctx context.Context, url string, opts ...RequestFunc) Result
- func Put(ctx context.Context, url string, opts ...RequestFunc) Result
- func Trace(ctx context.Context, url string, opts ...RequestFunc) Result
- type ResultError
- type Retry
- type RetryError
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Caller ¶
type Caller struct {
// contains filtered or unexported fields
}
type NoRetryError ¶
type NoRetryError struct {
// contains filtered or unexported fields
}
func (*NoRetryError) Unwrap ¶
func (n *NoRetryError) Unwrap() error
type Option ¶
type Option func(config *option)
func WithConnTimeout ¶
func WithCookieJar ¶
func WithKeepAlive ¶
func WithMaxIdleConn ¶
func WithParseFunc ¶
func WithProxyURL ¶
func WithReadBuffer ¶
func WithRedirect ¶
func WithTimeout ¶
func WithWriteBuffer ¶
type RequestFunc ¶
type RequestFunc func(req *request)
func WithBody ¶
func WithBody(body io.Reader) RequestFunc
func WithHeader ¶
func WithHeader(header map[string]string) RequestFunc
func WithQuery ¶
func WithQuery(query map[string]string) RequestFunc
type Result ¶
type ResultError ¶
type ResultError struct {
// contains filtered or unexported fields
}
func UnWarpError ¶
func UnWarpError(err error) (*ResultError, error)
func (*ResultError) Error ¶
func (h *ResultError) Error() string
func (*ResultError) Message ¶
func (h *ResultError) Message() string
func (*ResultError) StatusCode ¶
func (h *ResultError) StatusCode() int
func (*ResultError) Unwrap ¶
func (h *ResultError) Unwrap() error
type RetryError ¶
type RetryError struct {
// contains filtered or unexported fields
}
func (*RetryError) Error ¶
func (e *RetryError) Error() string
func (*RetryError) Unwrap ¶
func (e *RetryError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.