http

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Circuit

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

func NewCircuit

func NewCircuit(c CircuitConfig) *Circuit

func (*Circuit) Do

func (c *Circuit) Do(command string, fu CircuitFunc, fallback func(error) error, fi ...CircuitErrorFilter) error

func (*Circuit) DoR

func (c *Circuit) DoR(
	command string,
	fu CircuitFunc,
	fallback func(error) error,
	retry int,
	delay time.Duration,
	fi ...CircuitErrorFilter,
) error

type CircuitConfig

type CircuitConfig struct {
	Name                   string
	Timeout                int
	MaxConcurrentRequests  int
	ErrorPercentThreshold  int
	RequestVolumeThreshold int
	SleepWindow            int
	Commands               []string
}

type CircuitErrorFilter

type CircuitErrorFilter func(error) (bool, error)

type CircuitFunc

type CircuitFunc func() error

Jump to

Keyboard shortcuts

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