docker

package
v0.0.0-...-089ce19 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package docker defines a proxy for the Docker API.

Summary: Change the internal container state transparently while providing an otherwise unmodified view from the external API.

patch for:

  • /start
  • /restart
  • /unpause

unpatch for:

  • /export
  • /commit
  • /changes // TODO: Unimplemented
  • /archive // TODO: Unimplemented

ignore:

  • RestartPolicy -> no need to re-patch UNLESS if fail+restart during unpatch
  • /exec/start -> no need to re-patch since container must already be started

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerTruststorePatcher

type ContainerTruststorePatcher struct {
	// contains filtered or unexported fields
}

ContainerTruststorePatcher provides a Docker API proxy that patches the container truststore while running.

func NewContainerTruststorePatcher

func NewContainerTruststorePatcher(cert x509.Certificate, opts ContainerTruststorePatcherOpts) (*ContainerTruststorePatcher, error)

NewContainerTruststorePatcher creates a new ContainerTruststorePatcher with the provided certificate and options.

func (*ContainerTruststorePatcher) Proxy

func (d *ContainerTruststorePatcher) Proxy(srvAddr, dockerAddr string)

Proxy serves the Docker API while patching the container truststore.

type ContainerTruststorePatcherOpts

type ContainerTruststorePatcherOpts struct {
	EnvVars         []string
	JavaEnvVar      bool
	RecursiveProxy  bool
	NetworkOverride string
}

ContainerTruststorePatcherOpts defines the optional parameters for creating a ContainerTruststorePatcher.

type UDSHTTPClient

type UDSHTTPClient struct {
	*http.Client
}

UDSHTTPClient is a client that routes all requests to a UNIX Domain Socket.

func NewUDSHTTPClient

func NewUDSHTTPClient(socket string) *UDSHTTPClient

NewUDSHTTPClient returns a new UDS HTTP client.

func (*UDSHTTPClient) Do

func (c *UDSHTTPClient) Do(req *http.Request) (resp *http.Response, err error)

Do executes a HTTP Request routed through the UDS socket.

func (*UDSHTTPClient) Get

func (c *UDSHTTPClient) Get(url string) (resp *http.Response, err error)

Get executes a HTTP GET Request routed through the UDS socket.

func (*UDSHTTPClient) Head

func (c *UDSHTTPClient) Head(url string) (resp *http.Response, err error)

Head executes a HTTP HEAD Request routed through the UDS socket.

func (*UDSHTTPClient) Post

func (c *UDSHTTPClient) Post(url, contentType string, body io.Reader) (resp *http.Response, err error)

Post executes a HTTP POST Request routed through the UDS socket.

func (*UDSHTTPClient) PostForm

func (c *UDSHTTPClient) PostForm(url string, data url.Values) (resp *http.Response, err error)

PostForm executes a HTTP POST Request routed through the UDS socket.

Jump to

Keyboard shortcuts

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