stdclient

package
v0.0.0-...-1ec8499 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultTransport

func DefaultTransport() *http.Transport

Types

type Client

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

Client is a custom implementation of an HTTP client that can be used to perform HTTP requests.

func New

func New(opts ...Opt) *Client

New is a constructor function that creates a new instance of the Client type.

func (*Client) Do

Do perform an HTTP request with the given request.Request and returns a response.Response and an error, if any.

type Opt

type Opt func(*Client)

Opt is a functional option for the Client.

func WithClient

func WithClient(std *http.Client) Opt

WithClient is an option that sets the http.Client instance.

Be careful when used in combination with WithProxyAddr, as it will override the transport settings.

func WithProxyAddr

func WithProxyAddr(addr string) Opt

WithProxyAddr is an option that sets the proxy address.

Be careful when used in combination with WithClient, as it will override the transport settings.

Jump to

Keyboard shortcuts

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