package
0.1.3
Repository: https://github.com/xwc1125/xwc1125-pkg.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

NewBreaker return a sreBresker with options.
WithBucket set the bucket number in a window duration.
WithRequest with the minimum number of requests allowed.
WithSuccess with the K = 1 / Success value of sre breaker, default success is 0.5 Reducing the K will make adaptive throttling behave more aggressively, Increasing the K will make adaptive throttling behave less aggressively.
WithWindow with the duration size of the statistical window.

# Constants

StateClosed when circuit breaker closed, request allowed, the breaker calc the succeed ratio, if request num greater request setting and ratio lower than the setting ratio, then reset state to open.
StateOpen when circuit breaker open, request not allowed, after sleep some duration, allow one single request for testing the health, if ok then state reset to closed, if not continue the step.

# Structs

Breaker is a sre CircuitBreaker pattern.

# Type aliases

Option is sre breaker option function.