httpcli

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyHeader

func CopyHeader(dst http.Header, src http.Header)

func CtxWithHeader

func CtxWithHeader(ctx context.Context, header http.Header) context.Context

func HeaderFromCtx

func HeaderFromCtx(ctx context.Context) http.Header

func NewRoundTripper

func NewRoundTripper(cfg *TransportOptions) (http.RoundTripper, error)

Types

type Client

type Client struct {
	http.Client
	Header http.Header
}

Client ...

func NewClient

func NewClient(rt http.RoundTripper) *Client

NewClient ...

func (*Client) Do

func (c *Client) Do(req *http.Request) ([]byte, error)

Do ...

type TransportOptions

type TransportOptions struct {
	MaxIdleConnsPerHost   int
	InsecureSkipVerify    bool
	DisableHTTP2          bool
	DialTimeout           time.Duration
	ResponseHeaderTimeout time.Duration
	IdleConnTimeout       time.Duration
	ReadIdleTimeout       time.Duration
	PingTimeout           time.Duration
}

Jump to

Keyboard shortcuts

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