Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var OpenCircuitError = errors.New("open circuit breaker")
OpenCircuitError error is returned when circuit is open.
var RetryExceeded = errors.New("retry attempts exceeded")
RetryExceeded represents the error returned when client fail to send request after retry.
var (
TimeOutError = errors.New("Timeout")
)
Functions ¶
Types ¶
type Extension ¶
Extension define a decorator to apply on client for customization purposes.
func NewCircuitBreakerExt ¶
func NewCircuitBreakerExt(cb *circuit.Breaker) Extension
NewCircuitBreakerExt returns an extension that implements the circuit breaker pattern. Currently no remote exception is counted. FIXME: extensions are client specific this mean that all requests share same cb.
func NewRetryExt ¶
NewRetryExt returns an extension that wraps a client to retry failed requests using given backoff. This extension assuming nothing about whether service is idempotent or not, only request that are not sent are retried. FIXME: Middlewares are client specific this mean that all requests share the same backoff.
func NewTimeoutExt ¶
NewTimeoutExt returns an extension that wraps a client to timeout a request when this later take more than given duration.