Documentation ¶
Overview ¶
Package circuitbreaker is a pluggable circuit breaker module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, s CircuitBreaker)
Register registers a named circuit breaker.
func SetDefaultCircuitBreaker ¶
func SetDefaultCircuitBreaker(cb CircuitBreaker)
SetDefaultCircuitBreaker sets the default circuit breaker.
Types ¶
type CircuitBreaker ¶
type CircuitBreaker interface { Available(node *registry.Node) bool Report(node *registry.Node, cost time.Duration, err error) error }
CircuitBreaker is the interface that defines the circuit breaker which determines whether a node is available and report the result of an RPC on the node.
var DefaultCircuitBreaker CircuitBreaker = &NoopCircuitBreaker{}
DefaultCircuitBreaker is the default circuit breaker.
type NoopCircuitBreaker ¶
type NoopCircuitBreaker struct{}
NoopCircuitBreaker is a noop circuit breaker.
Click to show internal directories.
Click to hide internal directories.