circuitbreaker

package
v0.0.0-...-e9a242d Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FlowMetricKey string = "flow"
	NameMetricKey string = "name"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CBObservability

type CBObservability struct {
	// contains filtered or unexported fields
}

func NewCBObservability

func NewCBObservability(
	registry *prometheus.Registry,
	log *slog.Logger,
	name string,
	flow string,
) *CBObservability

func (*CBObservability) SetCBClosed

func (cbO11y *CBObservability) SetCBClosed()

func (*CBObservability) SetCBOpen

func (cbO11y *CBObservability) SetCBOpen()

type CircuitBreaker

type CircuitBreaker interface {
	Execute(func() (interface{}, error)) (interface{}, error)
}

type DummyCircuitBreaker

type DummyCircuitBreaker struct{}

A Circuitbreaker that accepts all requests and never trips. Useful in cases where you want to not have a CB.

func NewDummyCircuitBreaker

func NewDummyCircuitBreaker() *DummyCircuitBreaker

func (*DummyCircuitBreaker) Execute

func (cb *DummyCircuitBreaker) Execute(f func() (interface{}, error)) (interface{}, error)

type DummyTwoStepCircuitBreaker

type DummyTwoStepCircuitBreaker struct{}

A Circuitbreaker that accepts all requests and never trips. Useful in cases where you want to not have a CB.

func NewDummyTwoStepCircuitBreaker

func NewDummyTwoStepCircuitBreaker() *DummyTwoStepCircuitBreaker

func (*DummyTwoStepCircuitBreaker) Allow

func (cb *DummyTwoStepCircuitBreaker) Allow() (func(bool), error)

type TwoStepCircuitBreaker

type TwoStepCircuitBreaker interface {
	Allow() (func(bool), error)
}

Jump to

Keyboard shortcuts

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