Versions in this module Expand all Collapse all v0 v0.1.0 Jan 17, 2026 Changes in this version + var ErrBodyNotReplayable = errors.New("request body is not replayable") + var ErrCircuitOpen = errors.New("circuit breaker open") + func DefaultBreakerDecider(req *http.Request, resp *http.Response, err error) bool + func DefaultRetryDecider(req *http.Request, resp *http.Response, err error) bool + func NewClient(options ClientOptions) *http.Client + type BackoffFunc func(attempt int) time.Duration + func ExponentialBackoff(base, max time.Duration) BackoffFunc + type BreakerDecider func(req *http.Request, resp *http.Response, err error) bool + type BreakerRoundTripper struct + Base http.RoundTripper + Breaker *CircuitBreaker + ShouldTrip BreakerDecider + func (b *BreakerRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) + type CircuitBreaker struct + func NewCircuitBreaker(options CircuitBreakerOptions) *CircuitBreaker + func (c *CircuitBreaker) Allow() error + func (c *CircuitBreaker) Record(success bool) + type CircuitBreakerOptions struct + MaxFailures int + Now func() time.Time + OnStateChange func(state string) + ResetTimeout time.Duration + type ClientOptions struct + Breaker *CircuitBreaker + PropagateMetadata bool + Retry RetryOptions + ShouldTrip BreakerDecider + Timeout time.Duration + Transport http.RoundTripper + func DefaultClientOptions() ClientOptions + type MetadataRoundTripper struct + Base http.RoundTripper + func (m *MetadataRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) + type RetryDecider func(req *http.Request, resp *http.Response, err error) bool + type RetryOptions struct + Backoff BackoffFunc + MaxRetries int + OnRetry func(attempt int, err error, resp *http.Response) + RetryIf RetryDecider + func DefaultRetryOptions() RetryOptions + type RetryRoundTripper struct + Base http.RoundTripper + Options RetryOptions + Sleep func(time.Duration) + func (r *RetryRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)