http

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCircuitBreaker = errors.New("service unreachable")

Functions

This section is empty.

Types

type Circuit

type Circuit func(r *http.Request) (*http.Response, error)

func Breaker

func Breaker(circuit Circuit, failureThreshold int) Circuit

func DebounceFirst

func DebounceFirst(circuit Circuit, duration time.Duration) Circuit

type Client

type Client interface {
	DoRequest(*http.Request) (*http.Response, error)
}

func New

func New(opts ...Opt) Client

type ClientImpl

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

func (ClientImpl) DoRequest

func (c ClientImpl) DoRequest(r *http.Request) (*http.Response, error)

type Opt

type Opt func(client *ClientImpl)

func WithRetryThreshold

func WithRetryThreshold(retryThreshold int) Opt

func WithTimeout

func WithTimeout(timeout time.Duration) Opt

Jump to

Keyboard shortcuts

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