cbreaker

package
v1.26.7 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircuitBreaker

type CircuitBreaker struct{}

func NewCircuitBreaker

func NewCircuitBreaker() *CircuitBreaker

func (CircuitBreaker) Handler

func (CircuitBreaker) Handler(proxyRoute gobis.ProxyRoute, params interface{}, handler http.Handler) (http.Handler, error)

func (CircuitBreaker) Schema

func (CircuitBreaker) Schema() interface{}

type CircuitBreakerConfig

type CircuitBreakerConfig struct {
	CircuitBreaker *CircuitBreakerOptions `mapstructure:"circuit_breaker" json:"circuit_breaker" yaml:"circuit_breaker"`
}

type CircuitBreakerOptions

type CircuitBreakerOptions struct {
	// enable conn limit middleware
	Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
	// Limit number of simultaneous connection (default to 20)
	Expression string `mapstructure:"expression" json:"expression" yaml:"expression"`
	// Identify request source to limit the source
	// possible value are 'client.ip', 'request.host' or 'request.header.X-My-Header-Name'
	// (default: client.ip)
	FallbackUrl string `mapstructure:"fallback_url" json:"fallback_url" yaml:"fallback_url"`
	// FallbackDuration is how long the CircuitBreaker will remain in the Tripped in second
	// state before trying to recover.
	FallbackDuration int64 `mapstructure:"fallback_duration" json:"fallback_duration" yaml:"fallback_duration"`
	// RecoveryDuration is how long the CircuitBreaker will take to ramp up in second
	// requests during the Recovering state.
	RecoveryDuration int64 `mapstructure:"recovery_duration" json:"recovery_duration" yaml:"recovery_duration"`
	// CheckPeriod is how long the CircuitBreaker will wait between successive in second
	// checks of the breaker condition.
	CheckPeriod int64 `mapstructure:"check_period" json:"check_period" yaml:"check_period"`
}

Jump to

Keyboard shortcuts

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