web

package
v0.0.0-...-dc23390 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package web provides utilities for sending and receiving data via the web.

Index

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

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
}

HTTPError represents an HTTP error that can be handled differently in recovery.

func (*HTTPError) Error

func (err *HTTPError) Error() string

Directories

Path Synopsis
Package rest provides REST clients.
Package rest provides REST clients.

Jump to

Keyboard shortcuts

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