Documentation ¶
Index ¶
- Constants
- func Abort(ctx *gin.Context, code int, msg string)
- func Extract(bind string) (string, error)
- func InBlacklist(uid string) bool
- func Listen(network string, addr string) (net.Listener, error)
- func ResponseJSON(ctx *gin.Context, code int, msg string, data interface{})
- func UpdateProc(service string)
- func WatchBlacklist()
- type CBOption
- type CircuitBreaker
- type Counter
- type RateLimiter
- type Response
Constants ¶
View Source
const ( FanIn = 1 << 0 FanOut = 1 << 1 )
Variables ¶
This section is empty.
Functions ¶
func InBlacklist ¶
func UpdateProc ¶
func UpdateProc(service string)
func WatchBlacklist ¶
func WatchBlacklist()
Types ¶
type CBOption ¶
type CBOption func(cb *CircuitBreaker)
func WithDuration ¶
func WithFailsLimit ¶
func WithLatencyLimit ¶
func WithTotalLimit ¶
type CircuitBreaker ¶
type CircuitBreaker struct {
// contains filtered or unexported fields
}
func NewCircuitBreaker ¶
func NewCircuitBreaker(opts ...CBOption) *CircuitBreaker
func (*CircuitBreaker) Allow ¶
func (cb *CircuitBreaker) Allow(f func() bool) bool
type RateLimiter ¶
func NewRateLimiter ¶
func NewRateLimiter(size int, rate int64, mode int) (RateLimiter, error)
Click to show internal directories.
Click to hide internal directories.