Versions in this module Expand all Collapse all v0 v0.1.0 Mar 23, 2026 Changes in this version + var ErrCircuitOpen = circuitbreaker.ErrCircuitOpen + var ErrNoHealthy = balancer.ErrNoHealthy + var ErrRetryExhausted = retry.ErrRetryExhausted + func NewFormRequest(ctx context.Context, method, rawURL string, values url.Values) (*http.Request, error) + func NewJSONRequest(ctx context.Context, method, url string, body any) (*http.Request, error) + func NewRequest(ctx context.Context, method, url string, body io.Reader) (*http.Request, error) + type Client struct + func New(opts ...Option) *Client + func (c *Client) Close() + func (c *Client) Delete(ctx context.Context, url string) (*Response, error) + func (c *Client) Do(ctx context.Context, req *http.Request) (*Response, error) + func (c *Client) Get(ctx context.Context, url string) (*Response, error) + func (c *Client) HTTPClient() *http.Client + func (c *Client) Patch(ctx context.Context, url string, body io.Reader) (*Response, error) + func (c *Client) Post(ctx context.Context, url string, body io.Reader) (*Response, error) + func (c *Client) Put(ctx context.Context, url string, body io.Reader) (*Response, error) + type Error struct + Endpoint string + Err error + Op string + Retries int + StatusCode int + URL string + func (e *Error) Error() string + func (e *Error) Unwrap() error + type ErrorMapper func(resp *http.Response) error + type Option func(*clientOptions) + func WithBalancer(opts ...balancer.Option) Option + func WithBaseURL(url string) Option + func WithCircuitBreaker(opts ...circuitbreaker.Option) Option + func WithEndpoints(eps ...balancer.Endpoint) Option + func WithErrorMapper(m ErrorMapper) Option + func WithLogger(l *slog.Logger) Option + func WithMaxResponseBody(n int64) Option + func WithMiddleware(mws ...middleware.Middleware) Option + func WithRetry(opts ...retry.Option) Option + func WithTimeout(d time.Duration) Option + func WithTransport(rt http.RoundTripper) Option + type Response struct + func (r *Response) BodyReader() io.Reader + func (r *Response) Bytes() ([]byte, error) + func (r *Response) Close() error + func (r *Response) IsError() bool + func (r *Response) IsSuccess() bool + func (r *Response) JSON(v any) error + func (r *Response) String() (string, error) + func (r *Response) XML(v any) error