transport

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package transport provides function to send request to remote endpoints.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TLSConfigClone

func TLSConfigClone(c *tls.Config) *tls.Config

TLSConfigClone returns a clone of tls.Config. This function is provided for compatibility for go1.7 that doesn't include this method in stdlib.

Types

type Client

type Client interface {
	Sender
	// Secure tells whether the connection is secure or not.
	Secure() bool
	// Scheme returns the connection protocol the client uses.
	Scheme() string
	// TLSConfig returns any TLS configuration the client uses.
	TLSConfig() *tls.Config
}

Client is an interface that abstracts all remote connections.

func NewTransportWithHTTP

func NewTransportWithHTTP(proto, addr string, client *http.Client) (Client, error)

NewTransportWithHTTP creates a new transport based on the provided proto, address and http client. It uses Docker's default http transport configuration if the client is nil. It does not modify the client's transport if it's not nil.

type Sender

type Sender interface {
	// Do sends request to a remote endpoint.
	Do(*http.Request) (*http.Response, error)
}

Sender is an interface that clients must implement to be able to send requests to a remote connection.

Directories

Path Synopsis
Package cancellable provides helper function to cancel http requests.
Package cancellable provides helper function to cancel http requests.

Jump to

Keyboard shortcuts

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