httpcg

package module
v0.0.0-...-1648686 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 1

README

httpclient

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClientBuilder

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

func NewBuilder

func NewBuilder() HTTPClientBuilder

NewBuilder will return a new builder for the http.Client.

func (HTTPClientBuilder) Build

func (b HTTPClientBuilder) Build() (*http.Client, error)

Build will grab all the builder settings and generate an http.client

func (HTTPClientBuilder) ConnectionTimeout

func (b HTTPClientBuilder) ConnectionTimeout(t time.Duration) HTTPClientBuilder

ConnectionTimeout will set the max amount of time to wait until the TCP connections gets established.

func (HTTPClientBuilder) ExpectContinueTimeout

func (b HTTPClientBuilder) ExpectContinueTimeout(t time.Duration) HTTPClientBuilder

func (HTTPClientBuilder) IdleConnTimeout

func (b HTTPClientBuilder) IdleConnTimeout(t time.Duration) HTTPClientBuilder

func (HTTPClientBuilder) MaxIdleConn

func (b HTTPClientBuilder) MaxIdleConn(all, host int) HTTPClientBuilder

MaxIdleConn will set how many connections are allowed to be on idle in total and per host.

The value of all should be always bigger than host.

func (HTTPClientBuilder) ResponseHeaderTimeout

func (b HTTPClientBuilder) ResponseHeaderTimeout(t time.Duration) HTTPClientBuilder

func (HTTPClientBuilder) TLSHandshakeTimeout

func (b HTTPClientBuilder) TLSHandshakeTimeout(t time.Duration) HTTPClientBuilder

TLSHandshakeTimeout will set the max amount of time to wait until the TSL Handshake get completed.

func (HTTPClientBuilder) WithCookies

func (b HTTPClientBuilder) WithCookies() HTTPClientBuilder

func (HTTPClientBuilder) WithHTTP2

func (b HTTPClientBuilder) WithHTTP2() HTTPClientBuilder

func (HTTPClientBuilder) WithKeepAlive

func (b HTTPClientBuilder) WithKeepAlive(t time.Duration) HTTPClientBuilder

Jump to

Keyboard shortcuts

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