aurestbreaker

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instrument added in v0.4.0

func Instrument(
	client aurestclientapi.Client,
	stateChangeCallback StateChangeCallbackFunction,
	countsCallback CountsCallbackFunction,
)

Instrument adds instrumentation.

Either of the callbacks may be nil.

func New

func New(
	wrapped aurestclientapi.Client,
	circuitBreakerName string,
	maxNumRequestsInHalfOpenState uint32,
	counterClearingIntervalWhileClosed time.Duration,
	timeUntilHalfopenAfterOpen time.Duration,
	requestTimeout time.Duration,
) aurestclientapi.Client

Types

type CountsCallbackFunction added in v0.4.0

type CountsCallbackFunction func(circuitBreakerName string, counts gobreaker.Counts)

type Impl

type Impl struct {
	Wrapped aurestclientapi.Client

	Name           string
	CB             *gobreaker.CircuitBreaker
	RequestTimeout time.Duration

	StateChangeCallback StateChangeCallbackFunction
	CountsCallback      CountsCallbackFunction
}

func (*Impl) Perform

func (c *Impl) Perform(ctx context.Context, method string, requestUrl string, requestBody interface{}, response *aurestclientapi.ParsedResponse) error

type StateChangeCallbackFunction added in v0.4.0

type StateChangeCallbackFunction func(circuitBreakerName string, state string)

StateChangeCallbackFunction allows you to instrument the circuit breaker.

Jump to

Keyboard shortcuts

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