Documentation
¶
Index ¶
Constants ¶
View Source
const ( CircuitBreakerType = "cbreaker" CircuitBreakerID = "cb1" )
View Source
const ( ConnLimitType = "connlimit" ConnLimitID = "cl1" )
View Source
const ( RateLimitType = "ratelimit" RateLimitID = "rl1" )
View Source
const ( RewriteType = "rewrite" RewriteID = "rw1" )
View Source
const (
DefaultPriority = 1
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CircuitBreaker ¶
type CircuitBreaker struct {
Condition string `json:"Condition"`
Fallback string `json:"Fallback"`
CheckPeriod time.Duration `json:"CheckPeriod"`
FallbackDuration time.Duration `json:"FallbackDuration"`
RecoveryDuration time.Duration `json:"RecoveryDuration"`
OnTripped string `json:"OnTripped"`
OnStandby string `json:"OnStandby"`
}
CircuitBreaker is a spec for the respective vulcan's middleware that lets vulcan to fallback to some default response and trigger some action when an erroneous condition on a location is met.
func (CircuitBreaker) String ¶
func (cb CircuitBreaker) String() string
type ConnLimit ¶
ConnLimit is a spec for the respective vulcan's middleware that lets to control amount if simultaneous connections to locations.
type Middleware ¶
type Middleware struct {
Type string `json:"Type"`
ID string `json:"Id"`
Priority int `json:"Priority"`
Spec MiddlewareSpec `json:"Middleware"`
}
func NewCircuitBreaker ¶
func NewCircuitBreaker(spec CircuitBreaker) Middleware
func NewConnLimit ¶
func NewConnLimit(spec ConnLimit) Middleware
func NewRateLimit ¶
func NewRateLimit(spec RateLimit) Middleware
func NewRewrite ¶
func NewRewrite(spec Rewrite) Middleware
func (Middleware) String ¶
func (m Middleware) String() string
type MiddlewareSpec ¶
type MiddlewareSpec interface{}
type RateLimit ¶
type RateLimit struct {
Variable string `json:"Variable"`
Requests int `json:"Requests"`
PeriodSeconds int `json:"PeriodSeconds"`
Burst int `json:"Burst"`
}
RateLimit is a spec for the respective vulcan's middleware that lets to apply request rate limits to locations.
Click to show internal directories.
Click to hide internal directories.