breaker

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breaker

type Breaker interface {
	Success()
	Fail()
	Ready() bool
	Reset()
}

func NewCircuitBreaker

func NewCircuitBreaker(config *Config) Breaker

func NewNoOpBreaker

func NewNoOpBreaker() Breaker

type CircuitBreaker

type CircuitBreaker struct {
	// contains filtered or unexported fields
}

func (*CircuitBreaker) Fail

func (c *CircuitBreaker) Fail()

func (*CircuitBreaker) Ready

func (c *CircuitBreaker) Ready() bool

func (*CircuitBreaker) Reset

func (c *CircuitBreaker) Reset()

func (*CircuitBreaker) Success

func (c *CircuitBreaker) Success()

type Config

type Config struct {
	InitialInterval     time.Duration
	RandomizationFactor float64
	Multiplier          float64
	MaxInterval         time.Duration
	FailureThreshold    int64
}

type NoOpBreaker

type NoOpBreaker struct{}

func (*NoOpBreaker) Fail

func (b *NoOpBreaker) Fail()

func (*NoOpBreaker) Ready

func (b *NoOpBreaker) Ready() bool

func (*NoOpBreaker) Reset

func (b *NoOpBreaker) Reset()

func (*NoOpBreaker) Success

func (b *NoOpBreaker) Success()

Jump to

Keyboard shortcuts

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