container

package
v0.0.0-...-8cf122d Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsContainerNotFound

func IsContainerNotFound(err error) bool

IsContainerNotFound checks if an error is a ContainerNotFoundError

func RemoveContainer

func RemoveContainer(ctx context.Context, containerID string) error

func StopContainer

func StopContainer(ctx context.Context, containerID string) error

Types

type Client

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

func NewClient

func NewClient() (*Client, error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) CreateContainer

func (c *Client) CreateContainer(ctx context.Context, config ContainerConfig) (*Container, error)

func (*Client) FindContainer

func (c *Client) FindContainer(ctx context.Context, labels []string) (*Container, error)

func (*Client) InspectContainer

func (c *Client) InspectContainer(ctx context.Context, containerID string) (container.InspectResponse, error)

func (*Client) ListContainers

func (c *Client) ListContainers(ctx context.Context, labels []string) ([]Container, error)

func (*Client) RemoveContainer

func (c *Client) RemoveContainer(ctx context.Context, containerID string) error

func (*Client) StopContainer

func (c *Client) StopContainer(ctx context.Context, containerID string) error

type Container

type Container struct {
	ID    string
	State string
	// contains filtered or unexported fields
}

func (*Container) AttachAndRun

func (c *Container) AttachAndRun(ctx context.Context, command []string) error

func (*Container) CreateFile

func (c *Container) CreateFile(ctx context.Context, path string, content []byte) error

type ContainerConfig

type ContainerConfig struct {
	Image       string
	Command     []string
	Interactive bool
	Binds       []string
}

type ContainerNotFoundError

type ContainerNotFoundError struct {
	Labels []string
}

func (*ContainerNotFoundError) Error

func (e *ContainerNotFoundError) Error() string

Error implements the error interface for ContainerNotFoundError

Jump to

Keyboard shortcuts

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