Documentation
¶
Index ¶
- func ValidPolicy(name Policy) bool
- type KeyPool
- type Policy
- type ProviderCircuitBreaker
- func (cb *ProviderCircuitBreaker) AllowAt(identity string, now time.Time) bool
- func (cb *ProviderCircuitBreaker) MarkFailureAt(identity string, now time.Time) bool
- func (cb *ProviderCircuitBreaker) MarkSuccess(identity string)
- func (cb *ProviderCircuitBreaker) OpenAt(identity string, now time.Time)
- func (cb *ProviderCircuitBreaker) State(identity string, now time.Time) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidPolicy ¶
Types ¶
type KeyPool ¶
type KeyPool struct {
// contains filtered or unexported fields
}
func NewKeyPool ¶
func NewKeyPool(keys []string, policy Policy, breaker *ProviderCircuitBreaker) (*KeyPool, error)
type ProviderCircuitBreaker ¶
type ProviderCircuitBreaker struct {
// contains filtered or unexported fields
}
func NewProviderCircuitBreaker ¶
func NewProviderCircuitBreaker(threshold int, cooldown time.Duration) (*ProviderCircuitBreaker, error)
func (*ProviderCircuitBreaker) AllowAt ¶
func (cb *ProviderCircuitBreaker) AllowAt(identity string, now time.Time) bool
func (*ProviderCircuitBreaker) MarkFailureAt ¶
func (cb *ProviderCircuitBreaker) MarkFailureAt(identity string, now time.Time) bool
func (*ProviderCircuitBreaker) MarkSuccess ¶
func (cb *ProviderCircuitBreaker) MarkSuccess(identity string)
Click to show internal directories.
Click to hide internal directories.