Documentation ¶
Index ¶
- func BasicAuth(user, password string, base http.RoundTripper) http.RoundTripper
- func BasicAuthHeader(user, password string) string
- func BearerAuth(token string, base http.RoundTripper) http.RoundTripper
- func DecorateHeaders(headers map[string]string) func(req *http.Request) error
- func DecorateQuery(params map[string]string) func(req *http.Request) error
- func Default() *http.Transport
- func Insecure() *http.Transport
- type Decorator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
func BasicAuth(user, password string, base http.RoundTripper) http.RoundTripper
BasicAuth creates an http transport performing basic auth
func BasicAuthHeader ¶
BasicAuthHeader returns the basic auth header
func BearerAuth ¶
func BearerAuth(token string, base http.RoundTripper) http.RoundTripper
BearerAuth creates an HTTP transport performing HTTP authorization using an OAuth 2.0 Bearer Token
func DecorateHeaders ¶
DecorateHeaders wraps the given http.Request with a decorator that adds the given parameters to the request headers.
func DecorateQuery ¶
DecorateQuery wraps the given http.Request with a decorator that adds the given parameters to the GET query string.
Types ¶
type Decorator ¶
type Decorator struct { // Decorator modifies the outgoing request Decorator func(*http.Request) error // Base is the base RoundTripper used to make HTTP requests. // If nil, http.DefaultTransport is used. Base http.RoundTripper }
Decorator is an http.RoundTripper that makes HTTP requests, wrapping a base RoundTripper and modifying given base requests.
Click to show internal directories.
Click to hide internal directories.