breaker

package
v2.8.18 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface added in v2.8.2

type Interface interface {
	Allow() bool
	Event() chan<- error
}

func NewService

func NewService(name string, ops ...Option) Interface

type Mood

type Mood int
const (
	NOOP Mood = iota
	OPTIMISTIC
	PESSIMISTIC
)

type Option

type Option func(s *service) error

func WithAutoTune added in v2.8.3

func WithAutoTune(m Mood, step, until int) Option

WithAutoTune will help reduce / increase the odds in the absence of an event

func WithAutoTuneENV added in v2.8.4

func WithAutoTuneENV() Option

WithAutoTuneENV will help reduce / increase the odds in the absence of an event

func WithBuffer

func WithBuffer(b uint) Option

func WithBufferENV added in v2.8.4

func WithBufferENV() Option

func WithIgnoreErrors

func WithIgnoreErrors(er ...error) Option

func WithInitChance added in v2.8.2

func WithInitChance(c uint8) Option

func WithInitChanceENV added in v2.8.2

func WithInitChanceENV() Option

func WithMaxStep added in v2.8.4

func WithMaxStep(c uint8) Option

func WithMinStep added in v2.8.4

func WithMinStep(c uint8) Option

func WithPrometheus

func WithPrometheus() Option

func WithThreshold

func WithThreshold(t uint) Option

WithThreshold is the allowed percentage to pass for example if the value is set to 7 any request with the chance of 93% or more will pass

func WithThresholdENV added in v2.8.4

func WithThresholdENV() Option

func WithUpdate

func WithUpdate(u time.Duration) Option

func WithUpdateENV added in v2.8.2

func WithUpdateENV() Option

Jump to

Keyboard shortcuts

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