client

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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
}

Client represents a wrapped HTTP client.

func NewClient

func NewClient(cfg ClientConfig) *Client

NewClient returns an initialized Client given the provided configuration.

func (*Client) Do

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do performs the provided http Request, returning the response.

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, cfg RequestConfig) (*http.Request, error)

NewRequest returns an *http.Request given the provided configuration.

type ClientConfig

type ClientConfig struct {
	DNSServer  *url.URL
	HTTP       core.HTTPVersion
	Insecure   bool
	Proxy      *url.URL
	Redirects  *int
	TLS        uint16
	UnixSocket string
}

ClientConfig represents the optional configuration parameters for a Client.

type RequestConfig

type RequestConfig struct {
	AWSSigV4    *aws.Config
	Basic       *core.KeyVal
	Bearer      string
	Data        io.Reader
	Form        []core.KeyVal
	Headers     []core.KeyVal
	HTTP        core.HTTPVersion
	JSON        io.Reader
	Method      string
	Multipart   *multipart.Multipart
	NoEncode    bool
	QueryParams []core.KeyVal
	Range       []string
	URL         *url.URL
	XML         io.Reader
}

RequestConfig represents the configuration for creating an HTTP request.

Jump to

Keyboard shortcuts

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