client

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: MIT Imports: 8 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 struct {
	// contains filtered or unexported fields
}

Client adapts the Moby split client to the older Docker SDK surface used here.

func NewClientWithOpts

func NewClientWithOpts(ops ...Opt) (*Client, error)

NewClientWithOpts constructs a compatibility client from Moby options.

func (*Client) Close

func (c *Client) Close() error

Close releases the underlying client.

func (*Client) ContainerCreate

func (c *Client) ContainerCreate(
	ctx context.Context,
	cfg *compatcontainer.Config,
	hostConfig *compatcontainer.HostConfig,
	networkingConfig *compatnetwork.NetworkingConfig,
	platform *ocispec.Platform,
	containerName string,
) (compatcontainer.CreateResponse, error)

ContainerCreate creates a container.

func (*Client) ContainerList

func (c *Client) ContainerList(
	ctx context.Context,
	options compatcontainer.ListOptions,
) ([]compatcontainer.Summary, error)

ContainerList lists containers matching the provided filters.

func (*Client) ContainerLogs

func (c *Client) ContainerLogs(
	ctx context.Context,
	containerID string,
	options compatcontainer.LogsOptions,
) (io.ReadCloser, error)

ContainerLogs returns a stream of a container's stdout/stderr. The caller must close it. Unless the container was created with a TTY, the stream is multiplexed per moby/moby/client's ContainerLogsOptions doc and must be demultiplexed with stdcopy.StdCopy before use.

func (*Client) ContainerRemove

func (c *Client) ContainerRemove(
	ctx context.Context,
	containerID string,
	options compatcontainer.RemoveOptions,
) error

ContainerRemove removes a container.

func (*Client) ContainerStart

func (c *Client) ContainerStart(
	ctx context.Context,
	containerID string,
	options compatcontainer.StartOptions,
) error

ContainerStart starts a container.

func (*Client) ContainerStop

func (c *Client) ContainerStop(
	ctx context.Context,
	containerID string,
	options compatcontainer.StopOptions,
) error

ContainerStop stops a container.

func (*Client) ContainerWait

func (c *Client) ContainerWait(
	ctx context.Context,
	containerID string,
	options compatcontainer.WaitOptions,
) compatcontainer.WaitResult

ContainerWait blocks until containerID satisfies options.Condition, matching github.com/moby/moby/client@v0.5.1 container_wait.go:41's (*Client).ContainerWait(ctx, containerID, ContainerWaitOptions) ContainerWaitResult, with the compat option/result types substituted in.

func (*Client) ImageBuild

func (c *Client) ImageBuild(
	ctx context.Context,
	buildContext io.Reader,
	options compatbuild.ImageBuildOptions,
) (compatbuild.ImageBuildResponse, error)

ImageBuild builds an image from a tar context.

func (*Client) ImageList

func (c *Client) ImageList(
	ctx context.Context,
	options compatimage.ListOptions,
) ([]compatimage.Summary, error)

ImageList lists local images.

func (*Client) ImagePull

func (c *Client) ImagePull(
	ctx context.Context,
	refStr string,
	options compatimage.PullOptions,
) (io.ReadCloser, error)

ImagePull pulls an image and returns a stream that must be closed by the caller.

func (*Client) ImageRemove

func (c *Client) ImageRemove(
	ctx context.Context,
	imageID string,
	options compatimage.RemoveOptions,
) ([]compatimage.DeleteResponse, error)

ImageRemove removes an image from the daemon.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) (any, error)

Ping checks daemon availability.

type Opt

type Opt = mobyclient.Opt

Opt aliases the Moby client option type.

func FromEnv

func FromEnv() Opt

FromEnv applies Docker-compatible client settings from the environment.

func WithAPIVersionNegotiation

func WithAPIVersionNegotiation() Opt

WithAPIVersionNegotiation enables API version negotiation.

func WithHost

func WithHost(host string) Opt

WithHost sets the daemon host.

Jump to

Keyboard shortcuts

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