Documentation
¶
Index ¶
- type Client
- func (c *Client) Create(ctx context.Context, hostConfig *container.HostConfig) (string, error)
- func (c *Client) CreateImageIfNotExists(ctx context.Context, image string) error
- func (c *Client) Exec(ctx context.Context, containerID, workingDir string, cmd []string) (*ExecRes, error)
- func (c *Client) ForceRemove(ctx context.Context, id string)
- func (c *Client) IsImageExists(ctx context.Context, image string) bool
- func (c *Client) List(ctx context.Context) ([]string, error)
- func (c *Client) PullImage(ctx context.Context, image string) error
- func (c *Client) Stats(ctx context.Context, id string) (types.ContainerStats, error)
- type ContainerPort
- type ExecRes
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
}
func NewClient ¶
func NewClient(containerPort ContainerPort, containerConfig *container.Config) *Client
NewContainerManager create the container manager with the given container configurations
func (*Client) CreateImageIfNotExists ¶
func (*Client) Exec ¶
func (c *Client) Exec(ctx context.Context, containerID, workingDir string, cmd []string) (*ExecRes, error)
Exec executes the given command to the container with the given id returns outBuffer, errBuffer, error
func (*Client) IsImageExists ¶
IsImageExists get the image list and compare the images with the given image if the image is in the list return true otherwise return false
type ContainerPort ¶
type ContainerPort interface { ImagePull(ctx context.Context, refStr string, options types.ImagePullOptions) (io.ReadCloser, error) ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *v1.Platform, containerName string) (container.ContainerCreateCreatedBody, error) ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error ContainerExecCreate(ctx context.Context, id string, options types.ExecConfig) (types.IDResponse, error) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) ContainerList(ctx context.Context, options types.ContainerListOptions) ([]types.Container, error) ContainerRemove(ctx context.Context, id string, opt types.ContainerRemoveOptions) error ContainerStop(ctx context.Context, containerID string, duration *time.Duration) error ContainerStatsOneShot(ctx context.Context, id string) (types.ContainerStats, error) }
Click to show internal directories.
Click to hide internal directories.