circuitbreaker

package
v0.0.0-...-8b57a7c Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) client.ClientInterface

New -

Types

type Client

type Client struct {
	http.Client
	HystrixTimeout         time.Duration
	HystrixCommandName     string
	MaxConcurrentRequests  int
	RequestVolumeThreshold int
	SleepWindow            int
	ErrorPercentThreshold  int
	RetryCount             int
	Retrier                retry.Retriable
	FallbackFunc           func(err error) error
}

Client - is the hystrix client implementation

func (*Client) Do

func (c *Client) Do(request *http.Request) (*http.Response, error)

Do - http.Client implements do method

type Option

type Option func(*Client)

Option -

func CommandName

func CommandName(name string) Option

CommandName -

func ErrorPercentThreshold

func ErrorPercentThreshold(errorPercentThreshold int) Option

ErrorPercentThreshold -

func FallbackFunc

func FallbackFunc(fn fallbackFunc) Option

FallbackFunc -

func HystrixTimeout

func HystrixTimeout(timeout time.Duration) Option

HystrixTimeout -

func MaxConcurrentRequests

func MaxConcurrentRequests(maxConcurrentRequests int) Option

MaxConcurrentRequests -

func RequestVolumeThreshold

func RequestVolumeThreshold(requestVolumeThreshold int) Option

RequestVolumeThreshold -

func Retrier

func Retrier(retrier retry.Retriable) Option

Retrier -

func RetryCount

func RetryCount(retryCount int) Option

RetryCount -

func SleepWindow

func SleepWindow(sleepWindow int) Option

SleepWindow -

func Timeout

func Timeout(timeout time.Duration) Option

Timeout sets hystrix timeout

Jump to

Keyboard shortcuts

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