internal

package
v0.0.0-...-2d9777f Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 10 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 (*Client) CtxDo

func (c *Client) CtxDo(ctx context.Context, req *http.Request) (*http.Response, error)

func (*Client) DisableH2

func (c *Client) DisableH2() (ok bool)

func (*Client) UseCoreDialer

func (c *Client) UseCoreDialer(set func(*CoreDialer) http.Dialer) (ok bool)

UseCoreDialer is a shortcut to [UseDialer] that unwraps the current dialer until it meets a *CoreDialer returns false if no *CoreDialer is found

func (*Client) UseDialer

func (c *Client) UseDialer(wrap func(http.Dialer) http.Dialer)

UseDialer provides the interface to modify the dialer used for setting up the underlying connections that a request is sent to and a response is read from. Connection pooling should be implemented at this layer.

This package provides a default dialer type CoreDialer, which uses the pooling logic in the package [netpool]. Users are encouraged to re-use the package if they needed to implement their own [Dialer], however not necessary. Users could get the underlying default CoreDialer and modify the default logic by [Dialer.Unwrap]ping the given dialer.

For example, http2 can be disabled by removing the "h2" from tls ALPN. See how it is be done in Client.DisableH2.

func (*Client) UseGetProxy

func (c *Client) UseGetProxy(getProxy func(ctx context.Context, r *http.Request) (string, error)) (ok bool)

type CoreDialer

type CoreDialer = dialer.CoreDialer

type PreparedRequest

type PreparedRequest = http.PreparedRequest

Directories

Path Synopsis
package http contains the request and response type, which are meant to be exported.
package http contains the request and response type, which are meant to be exported.
h2c

Jump to

Keyboard shortcuts

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