gokhttp_client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

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

Types

type Option

type Option interface {
	Execute(client *http.Client) error
}

type ProxyOption

type ProxyOption struct {
	ProxyURL string
}

func NewProxyOption

func NewProxyOption(proxyURL string) *ProxyOption

func (*ProxyOption) Execute

func (o *ProxyOption) Execute(client *http.Client) error

type RedirectOption

type RedirectOption struct {
}

func (*RedirectOption) Execute

func (o *RedirectOption) Execute(client *http.Client) error

type TimeOutOption

type TimeOutOption struct {
	ClientTimeout         time.Duration
	TLSHandshakeTimeout   time.Duration
	ResponseHeaderTimeout time.Duration
	IdleConnTimeout       time.Duration
	ExpectContinueTimeout time.Duration
	WriteByteTimeout      time.Duration
	ReadIdleTimeout       time.Duration
	PingTimeout           time.Duration
}

func NewTimeOutOption

func NewTimeOutOption(client, handshake, responseHeader, idleConn, expectContinue, writeByte, readIdle, ping time.Duration) *TimeOutOption

func (*TimeOutOption) Execute

func (o *TimeOutOption) Execute(client *http.Client) error

Jump to

Keyboard shortcuts

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