docker

package
v0.0.0-...-4560a53 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: Zlib Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const OneMegabyte = 1024768

Variables

This section is empty.

Functions

This section is empty.

Types

type Transport

type Transport struct {
	HTTPTransport *http.Transport
	// contains filtered or unexported fields
}

Transport is a custom transport for Docker API reverse proxy. It allows interception of requests and rewriting of responses.

func NewTransport

func NewTransport(parameters *TransportParameters, httpTransport *http.Transport, gitService portainer.GitService) (*Transport, error)

NewTransport returns a pointer to a new Transport instance.

func (*Transport) ProxyDockerRequest

func (transport *Transport) ProxyDockerRequest(request *http.Request) (*http.Response, error)

ProxyDockerRequest intercepts a Docker API request and apply logic based on the requested operation.

func (*Transport) RoundTrip

func (transport *Transport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip is the implementation of the the http.RoundTripper interface

type TransportParameters

type TransportParameters struct {
	Endpoint             *portainer.Endpoint
	DataStore            dataservices.DataStore
	SignatureService     portainer.DigitalSignatureService
	ReverseTunnelService portainer.ReverseTunnelService
	DockerClientFactory  *dockerclient.ClientFactory
}

TransportParameters is used to create a new Transport

Jump to

Keyboard shortcuts

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