Documentation ¶
Index ¶
- Constants
- type CircuitBreaker
- func (cb *CircuitBreaker) Close()
- func (cb *CircuitBreaker) DefaultSpec() interface{}
- func (cb *CircuitBreaker) Description() string
- func (cb *CircuitBreaker) Handle(ctx context.HTTPContext) string
- func (cb *CircuitBreaker) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
- func (cb *CircuitBreaker) Init(filterSpec *httppipeline.FilterSpec)
- func (cb *CircuitBreaker) Kind() string
- func (cb *CircuitBreaker) Results() []string
- func (cb *CircuitBreaker) Status() interface{}
- type Policy
- type Spec
- type Status
- type URLRule
Constants ¶
View Source
const (
// Kind is the kind of CircuitBreaker.
Kind = "CircuitBreaker"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircuitBreaker ¶
type CircuitBreaker struct {
// contains filtered or unexported fields
}
CircuitBreaker defines the circuit breaker
func (*CircuitBreaker) DefaultSpec ¶
func (cb *CircuitBreaker) DefaultSpec() interface{}
DefaultSpec returns the default spec of CircuitBreaker.
func (*CircuitBreaker) Description ¶
func (cb *CircuitBreaker) Description() string
Description returns the description of CircuitBreaker
func (*CircuitBreaker) Handle ¶
func (cb *CircuitBreaker) Handle(ctx context.HTTPContext) string
Handle handles HTTP request
func (*CircuitBreaker) Inherit ¶
func (cb *CircuitBreaker) Inherit(filterSpec *httppipeline.FilterSpec, previousGeneration httppipeline.Filter)
Inherit inherits previous generation of CircuitBreaker.
func (*CircuitBreaker) Init ¶
func (cb *CircuitBreaker) Init(filterSpec *httppipeline.FilterSpec)
Init initializes CircuitBreaker.
func (*CircuitBreaker) Kind ¶
func (cb *CircuitBreaker) Kind() string
Kind returns the kind of CircuitBreaker.
func (*CircuitBreaker) Results ¶
func (cb *CircuitBreaker) Results() []string
Results returns the results of CircuitBreaker.
func (*CircuitBreaker) Status ¶
func (cb *CircuitBreaker) Status() interface{}
Status returns Status generated by Runtime.
type Policy ¶
type Policy struct { Name string `yaml:"name" jsonschema:"required"` SlidingWindowType string `yaml:"slidingWindowType" jsonschema:"omitempty,enum=COUNT_BASED,enum=TIME_BASED"` FailureRateThreshold uint8 `yaml:"failureRateThreshold" jsonschema:"omitempty,minimum=1,maximum=100"` SlowCallRateThreshold uint8 `yaml:"slowCallRateThreshold" jsonschema:"omitempty,minimum=1,maximum=100"` CountingNetworkError bool `yaml:"countingNetworkError" jsonschema:"omitempty"` SlidingWindowSize uint32 `yaml:"slidingWindowSize" jsonschema:"omitempty,minimum=1"` PermittedNumberOfCallsInHalfOpen uint32 `yaml:"permittedNumberOfCallsInHalfOpenState" jsonschema:"omitempty"` MinimumNumberOfCalls uint32 `yaml:"minimumNumberOfCalls" jsonschema:"omitempty"` SlowCallDurationThreshold string `yaml:"slowCallDurationThreshold" jsonschema:"omitempty,format=duration"` MaxWaitDurationInHalfOpen string `yaml:"maxWaitDurationInHalfOpenState" jsonschema:"omitempty,format=duration"` WaitDurationInOpen string `yaml:"waitDurationInOpenState" jsonschema:"omitempty,format=duration"` FailureStatusCodes []int `yaml:"failureStatusCodes" jsonschema:"omitempty,uniqueItems=true,format=httpcode-array"` }
Policy defines the policy of a circuit breaker
type Spec ¶
type Spec struct { Policies []*Policy `yaml:"policies" jsonschema:"required"` DefaultPolicyRef string `yaml:"defaultPolicyRef" jsonschema:"omitempty"` URLs []*URLRule `yaml:"urls" jsonschema:"required"` }
Spec is the configuration of a circuit breaker
Click to show internal directories.
Click to hide internal directories.