circuitbreaker

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 28, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAllowed = errorx.Unavailable("CIRCUIT_BREAKER_OPEN", "request failed due to circuit breaker triggered")

ErrNotAllowed is request failed due to circuit breaker triggered.

Functions

func Client

func Client(opts ...Option) middleware.Middleware

Client circuitbreaker middleware will return errBreakerTriggered when the circuit breaker is triggered and the request is rejected directly.

Types

type CircuitBreaker

type CircuitBreaker = internalbreaker.CircuitBreaker

CircuitBreaker is a circuit breaker.

type Option

type Option func(*options)

Option is circuit breaker option.

func WithBreakerFactory

func WithBreakerFactory(factory func() CircuitBreaker) Option

WithBreakerFactory configures a factory used to lazily create one circuit breaker per operation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL