http

package
v0.0.0-...-ccbf4c7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AuthenticatedClient   = &http.Client{}
	UnauthenticatedClient = &http.Client{}
)
View Source
var (
	TerminalClientOnlyRequest = 1
	TerminalClientVerbose     = 2
)

Functions

func NewTerminalClient

func NewTerminalClient(opts TerminalClientOptions) *http.Client

func NewTokenV1RoundTripper

func NewTokenV1RoundTripper() http.RoundTripper

func TsuruClientFromEnvironment

func TsuruClientFromEnvironment() (*tsuru.APIClient, error)

func UnwrapErr

func UnwrapErr(err error) error

Types

type TerminalClientOptions

type TerminalClientOptions struct {
	RoundTripper  http.RoundTripper
	ClientName    string
	ClientVersion string
	Stdout        io.Writer
	Stderr        io.Writer
}

type TerminalRoundTripper

type TerminalRoundTripper struct {
	http.RoundTripper
	Stdout         io.Writer
	Stderr         io.Writer
	CurrentVersion string
	Progname       string
}

TerminalRoundTripper is a RoundTripper that dumps request and response based on the Verbosity. Verbosity >= 1 --> Dumps request Verbosity >= 2 --> Dumps response

func (*TerminalRoundTripper) RoundTrip

func (v *TerminalRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

type TokenV1RoundTripper

type TokenV1RoundTripper struct {
	http.RoundTripper
}

func (*TokenV1RoundTripper) RoundTrip

func (v *TokenV1RoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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