Documentation ¶
Overview ¶
Package web provides utilities for sending and receiving data via the web.
Index ¶
- func NewBasicAuthRoundTripper(roundTripper http.RoundTripper, username, password string) http.RoundTripper
- func NewCustomHeadersRoundTripper(roundTripper http.RoundTripper, headers map[string]string) http.RoundTripper
- func NewLeveledLoggerRoundTripper(roundTripper http.RoundTripper, logger log.LeveledLogger) http.RoundTripper
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicAuthRoundTripper ¶
func NewBasicAuthRoundTripper(roundTripper http.RoundTripper, username, password string) http.RoundTripper
NewBasicAuthRoundTripper creates a RoundTripper that decorates another round tripper by adding basic auth using the specified username and password.
func NewCustomHeadersRoundTripper ¶
func NewCustomHeadersRoundTripper(roundTripper http.RoundTripper, headers map[string]string) http.RoundTripper
NewCustomHeadersRoundTripper creates a RoundTripper that decorates another round tripper by adding custom headers.
func NewLeveledLoggerRoundTripper ¶
func NewLeveledLoggerRoundTripper(roundTripper http.RoundTripper, logger log.LeveledLogger) http.RoundTripper
NewLeveledLoggerRoundTripper creates a RoundTripper that decorates another round tripper by using the specified leveled logger to log requests and responses only in the debug log level; and errors in all logging levels.
Types ¶
Click to show internal directories.
Click to hide internal directories.