httpclient

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeClient

func InitializeClient(hystrixCommand string, connectionPoolConfig ConnectionPoolConfig,
	hystrixConfig HystrixResiliencyConfig, retriable heimdall.Retriable,
	retryCount int, fallbackFunc func(error) error) (*hystrix.Client, error)

InitializeClient initialises the client

Types

type ConnectionPoolConfig

type ConnectionPoolConfig struct {
	Timeout            int    `yaml:"timeout"`          // in milliseconds
	KeepAliveTimeout   int    `yaml:"keepAliveTimeout"` // in milliseconds
	MaxIdleConnections int    `yaml:"maxIdleConnections"`
	PrivateKeyPath     string `yaml:"-"`
	CertPath           string `yaml:"-"`
}

type HystrixResiliencyConfig

type HystrixResiliencyConfig struct {
	// MaxConcurrentRequests is the maximum number of concurrent requests allowed
	// Default is 100
	MaxConcurrentRequests int `yaml:"maxConcurrentRequests"`
	// RequestVolumeThreshold is the minimum number of requests needed before a circuit can be tripped due to health
	// Default is 20
	RequestVolumeThreshold int `yaml:"requestVolumeThreshold"`
	// CircuitBreakerSleepWindow is how long, in milliseconds, to wait after a circuit opens before testing for recovery
	// Default is 5000
	CircuitBreakerSleepWindow int `yaml:"circuitBreakerSleepWindow"`
	// ErrorPercentThreshold causes circuits to open once the rolling measure of errors exceeds this percent of requests
	// Default is 50
	ErrorPercentThreshold int `yaml:"errorPercentThreshold"`
	// CircuitBreakerTimeout is how long to wait for command to complete, in milliseconds
	// Default is 1000
	CircuitBreakerTimeout int `yaml:"circuitBreakerTimeout"`
}

Jump to

Keyboard shortcuts

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