client

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package client provides some customizable http client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRoundTripper

func NewRoundTripper(
	keepaliveDuration time.Duration,
	connectTimeout time.Duration,
	responseHeaderTimeout time.Duration,
	idleConnectionTimeout time.Duration,
	maxIdleConnections int,
	serverName string,
) http.RoundTripper

NewRoundTripper returns a http.RoundTripper that has some tunable parameters.

Types

type Client

type Client interface {
	http.RoundTripper
	HttpClient() *http.Client

	Do(req *http.Request) (*http.Response, error)
	Get(url string) (resp *http.Response, err error)
	Head(url string) (resp *http.Response, err error)
	Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
	PostForm(url string, data url.Values) (resp *http.Response, err error)
	// contains filtered or unexported methods
}

Client is an http.Client with some tunable parameters.

func NewClient

func NewClient(
	keepaliveDuration time.Duration,
	connectTimeout time.Duration,
	responseHeaderTimeout time.Duration,
	idleConnectionTimeout time.Duration,
	maxIdleConnections int,
	redirectSupport bool,
	serverName string,
) Client

NewClient returns a Client interface that has some tunable parameters.

Jump to

Keyboard shortcuts

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