httpclient

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPConfig

type HTTPConfig struct {
	Timeout       int
	Username      string
	Password      string
	Headers       map[string]string
	SkipVerify    bool
	CookieManager bool
}

The configuration to build the HTTP client.

func (*HTTPConfig) Build

func (h *HTTPConfig) Build() (client *http.Client, err error)

Build returns a configured http.Client.

type TransportWithBasicAuth

type TransportWithBasicAuth struct {
	http.RoundTripper
	Username string
	Password string
}

An http transport that injects basic auth into each request.

func (*TransportWithBasicAuth) RoundTrip

func (t *TransportWithBasicAuth) RoundTrip(req *http.Request) (*http.Response, error)

Override the only method that the client actually calls on the transport to do the request.

Jump to

Keyboard shortcuts

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