docker

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error)
	ServerVersion(context.Context) (types.Version, error)
}

Client interface for testing purposes. Includes only the methods used by the underlying docker package.

type Docker

type Docker struct {
	Client Client
}

Docker for handling communication with the docker processes. Can be created with default settings by calling New or with a custom Client by manually instantiating this type.

func New

func New(ctx context.Context) (*Docker, error)

New returns a new Docker type with a default Client implementation.

func (*Docker) Port

func (d *Docker) Port(ctx context.Context, container string) (int, error)

Port returns the host-port the underlying docker process is currently bound to, for the given container. It determines this by walking through all the ports on the container and finding the one that is bound to ip 0.0.0.0.

func (*Docker) Version

func (d *Docker) Version(ctx context.Context) (Version, error)

Version returns the version information from the underlying docker process.

type Version

type Version struct {
	// Version is the platform version
	Version string
	// Arch is the platform architecture
	Arch string
	// Platform is the platform name
	Platform string
}

Version contains al the version information that is being tracked.

Jump to

Keyboard shortcuts

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