Help us shape the future of Go! Take the 2026 Go Developer Survey

httpclient

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(cfg Config, opts ...ClientOpt) *Client

func (*Client) HTTP

func (c *Client) HTTP() *http.Client

type ClientOpt

type ClientOpt func(*Client)

func WithHTTPClient

func WithHTTPClient(hc *http.Client) ClientOpt

type Config

type Config struct {
	TimeoutMS           int `mapstructure:"timeout_ms" yaml:"timeout_ms"`
	MaxConnsPerHost     int `mapstructure:"max_conns_per_host" yaml:"max_conns_per_host"`
	MaxIdleConns        int `mapstructure:"max_idle_conns" yaml:"max_idle_conns"`
	MaxIdleConnsPerHost int `mapstructure:"max_idle_conns_per_host" yaml:"max_idle_conns_per_host"`
	IdleConnTimeoutMS   int `mapstructure:"idle_conn_timeout_ms" yaml:"idle_conn_timeout_ms"`
}

Jump to

Keyboard shortcuts

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