zhttp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHttpClient

func NewHttpClient(options ...Option) (*http.Client, error)

Types

type HttpClientConfig

type HttpClientConfig struct {
	DialTimeout         time.Duration
	TLSHandshakeTimeout time.Duration
	Timeout             time.Duration
	MaxIdleConns        int
	IdleConnTimeout     time.Duration
	TlsConfig           *tls.Config
}

type Option

type Option func(*HttpClientConfig)

Option is a HttpClientConfig configurator to be supplied to NewHttpClientConfig() function.

func WithDialTimeout

func WithDialTimeout(timeout time.Duration) Option

WithDialTimeout sets the Timeout

func WithIdleConnTimeout

func WithIdleConnTimeout(idleconntimeout time.Duration) Option

WithIdleConnTimeout sets the IdleConnTimeout

func WithMaxIdleConns

func WithMaxIdleConns(maxidleconns int) Option

WithMaxIdleConns sets the MaxIdleConns

func WithTLSHandshakeTimeout

func WithTLSHandshakeTimeout(timeout time.Duration) Option

WithTLSHandshakeTimeout sets the Timeout

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout sets the Timeout

func WithTlsConfig

func WithTlsConfig(tlsConfig *tls.Config) Option

WithIdleConnTimeout sets the IdleConnTimeout

Jump to

Keyboard shortcuts

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