breaker

package
v2.8.3 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 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() <-chan bool
	Event() chan<- error
}

func NewService

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

type Mood

type Mood int
const (
	OPTIMISTIC Mood = iota
	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 WithBuffer

func WithBuffer(b uint) 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(c string) 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 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