package
0.0.3-alpha
Repository: https://github.com/lypee/sentinel-golang.git
Documentation: pkg.go.dev

# Functions

ClearRules clear all the previous rules.
ClearRulesOfResource clears resource level rules in circuitBreaker module.
ClearStateChangeListeners clears the all StateChangeListener Note: this function is not thread-safe.
GetRules returns all the rules based on copy.
GetRulesOfResource returns specific resource's rules based on copy.
No description provided by the author
LoadRules replaces old rules with the given circuit breaking rules.
LoadRulesOfResource loads the given resource's circuitBreaker rules to the rule manager, while all previous resource's rules will be replaced.
RegisterStateChangeListeners registers the global state change listener for all circuit breakers Note: this function is not thread-safe.
No description provided by the author
SetCircuitBreakerGenerator sets the circuit breaker generator for the given strategy.

# Constants

No description provided by the author
ErrorCount strategy changes the circuit breaker state based on error amount.
ErrorRatio strategy changes the circuit breaker state based on error request ratio.
No description provided by the author
No description provided by the author
No description provided by the author
SlowRequestRatio strategy changes the circuit breaker state based on slow request ratio.
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

MetricStatSlot records metrics for circuit breaker on invocation completed.
Rule encompasses the fields of circuit breaking rule.
No description provided by the author

# Interfaces

CircuitBreaker is the basic interface of circuit breaker.
StateChangeListener listens on the circuit breaker state change event.

# Type aliases

No description provided by the author
Circuit Breaker State Machine: switch to open based on rule +-----------------------------------------------------------------------+ | | | v +----------------+ +----------------+ Probe +----------------+ | | | |<----------------| | | | Probe succeed | | | | | Closed |<------------------| HalfOpen | | Open | | | | | Probe failed | | | | | +---------------->| | +----------------+ +----------------+ +----------------+.
Strategy represents the strategy of circuit breaker.