httpclient

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

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" json:"timeout_ms" yaml:"timeout_ms"`
	MaxConnsPerHost     int `mapstructure:"max_conns_per_host" json:"max_conns_per_host" yaml:"max_conns_per_host"`
	MaxIdleConns        int `mapstructure:"max_idle_conns" json:"max_idle_conns" yaml:"max_idle_conns"`
	MaxIdleConnsPerHost int `mapstructure:"max_idle_conns_per_host" json:"max_idle_conns_per_host" yaml:"max_idle_conns_per_host"`
	IdleConnTimeoutMS   int `mapstructure:"idle_conn_timeout_ms" json:"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