circut

package
v0.0.0-...-85902bd Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breaker

type Breaker struct {
	Down int32
	// contains filtered or unexported fields
}

Breaker represents circut breaker

func New

func New(resetDuration time.Duration, prober Prober) *Breaker

New creates a new circut breaker

func (*Breaker) FlagDown

func (b *Breaker) FlagDown()

FlagDown flags connection Down

func (*Breaker) FlagUp

func (b *Breaker) FlagUp()

FlagUp flags resource down

func (*Breaker) IsUp

func (b *Breaker) IsUp() bool

IsUp returns true if resource is up

type Prober

type Prober interface {
	//Probe checks if service is up, if so it should call FlagUp
	Probe()
}

Prober represents abstraction to check if service is up

Jump to

Keyboard shortcuts

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