hystrix

package
v0.0.0-...-3f93e99 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRecoverFromPanic = errors.New("circuit: recover from panic")
)

Functions

This section is empty.

Types

type Breaker

type Breaker struct {
	logger.Logger
	// contains filtered or unexported fields
}

Breaker implements circuit breaker

func New

func New(opts ...Option) *Breaker

New creates new circuit breaker instance

func (*Breaker) Execute

func (b *Breaker) Execute(h circuit.Handler) error

Execute executes handler within circuit breaker

func (*Breaker) ExecuteAsync

func (b *Breaker) ExecuteAsync(h circuit.Handler) error

ExecuteAsync executes handler within circuit breaker in async way

type Option

type Option func(*Options)

Option is a closure which should initialize specific Options properties

func WithLogger

func WithLogger(l logger.Logger) Option

WithLogger initializes logger option

func WithName

func WithName(n string) Option

WithName initializes name option

func WithTimeout

func WithTimeout(t int) Option

WithTimeout initializes timeout option

type Options

type Options struct {
	logger.Logger
	// contains filtered or unexported fields
}

Options declares circuit breaker options

Jump to

Keyboard shortcuts

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