client

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: MIT Imports: 22 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
}

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 {
	CACerts    []*x509.Certificate
	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