breaker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 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 interface {
	// Do runs the workFn with breaker.
	Do(workFn func() error) error

	// IsErrBerakerOpen check if the error due breaker open / not.
	IsErrBerakerOpen(err error) bool
}

Breaker provides list of standard's breaker functions.

func New

func New(v Vendor, conf Config) (Breaker, error)

New creates a breaker base on selected vendor.

type Config

type Config struct {
	Eapache *Eapache
}

Config provides list of breaker's vendor that can be used. It will prioritize from top to bottom and only choose one.

type Eapache

type Eapache struct {
	ErrorThres   int
	SuccessThres int
	Timeout      time.Duration
	// contains filtered or unexported fields
}

Eapache is config for eapache's breaker.

func (*Eapache) Do

func (cb *Eapache) Do(workFn func() error) error

Do from Eapache.

func (*Eapache) IsErrBerakerOpen

func (cb *Eapache) IsErrBerakerOpen(err error) bool

IsErrBerakerOpen from Eapache.

type Vendor

type Vendor string

Vendor as an alias.

const (
	EAPACHE Vendor = "eapache"
)

Consts

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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