Documentation
¶
Index ¶
- func Commit(ctx context.Context, client *containerd.Client, rawRef string, req string, ...) error
- func Exec(ctx context.Context, client *containerd.Client, args []string, ...) error
- func GenerateGroupsOpts(groups []string) ([]oci.SpecOpts, error)
- func GenerateUmaskOpts(umask string) ([]oci.SpecOpts, error)
- func GenerateUserOpts(user string) ([]oci.SpecOpts, error)
- func Inspect(ctx context.Context, client *containerd.Client, containers []string, ...) error
- func Kill(ctx context.Context, client *containerd.Client, reqs []string, ...) error
- func Logs(ctx context.Context, client *containerd.Client, container string, ...) error
- func NewStatusError(id string, status containerd.ProcessStatus) error
- func Pause(ctx context.Context, client *containerd.Client, reqs []string, ...) error
- func Remove(ctx context.Context, client *containerd.Client, containers []string, ...) error
- func RemoveContainer(ctx context.Context, c containerd.Container, ...) (retErr error)
- func Restart(ctx context.Context, client *containerd.Client, containers []string, ...) error
- func Start(ctx context.Context, client *containerd.Client, reqs []string, ...) error
- func Stop(ctx context.Context, client *containerd.Client, reqs []string, ...) error
- func Top(ctx context.Context, client *containerd.Client, containers []string, ...) error
- type ContainerTopOKBody
- type ErrContainerStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Commit ¶
func Commit(ctx context.Context, client *containerd.Client, rawRef string, req string, options types.ContainerCommitOptions) error
Commit will commit a container’s file changes or settings into a new image.
func Exec ¶
func Exec(ctx context.Context, client *containerd.Client, args []string, options types.ContainerExecOptions) error
Exec will find the right running container to run a new command.
func Inspect ¶
func Inspect(ctx context.Context, client *containerd.Client, containers []string, options types.ContainerInspectOptions) error
Inspect prints detailed information for each container in `containers`.
func Kill ¶
func Kill(ctx context.Context, client *containerd.Client, reqs []string, options types.KillOptions) error
Kill kills a list of containers
func Logs ¶
func Logs(ctx context.Context, client *containerd.Client, container string, options types.ContainerLogsOptions) error
func NewStatusError ¶
func NewStatusError(id string, status containerd.ProcessStatus) error
NewStatusError creates an ErrContainerStatus from container id and status.
func Pause ¶
func Pause(ctx context.Context, client *containerd.Client, reqs []string, options types.ContainerPauseOptions) error
func Remove ¶
func Remove(ctx context.Context, client *containerd.Client, containers []string, options types.ContainerRemoveOptions) error
Remove removes a list of `containers`.
func RemoveContainer ¶
func RemoveContainer(ctx context.Context, c containerd.Container, globalOptions types.GlobalCommandOptions, force bool, removeAnonVolumes bool) (retErr error)
RemoveContainer removes a container from containerd store.
func Restart ¶
func Restart(ctx context.Context, client *containerd.Client, containers []string, options types.ContainerRestartOptions) error
Restart will restart one or more containers.
func Start ¶
func Start(ctx context.Context, client *containerd.Client, reqs []string, options types.ContainerStartOptions) error
Start starts a list of `containers`. If attach is true, it only starts a single container.
func Stop ¶
func Stop(ctx context.Context, client *containerd.Client, reqs []string, opt types.ContainerStopOptions) error
func Top ¶
func Top(ctx context.Context, client *containerd.Client, containers []string, opt types.ContainerTopOptions) error
Top performs the equivalent of running `top` inside of container(s)
Types ¶
type ContainerTopOKBody ¶
type ContainerTopOKBody struct {
// Each process running in the container, where each is process
// is an array of values corresponding to the titles.
//
// Required: true
Processes [][]string `json:"Processes"`
// The ps column titles
// Required: true
Titles []string `json:"Titles"`
}
ContainerTopOKBody is from https://github.com/moby/moby/blob/v20.10.6/api/types/container/container_top.go
ContainerTopOKBody OK response to ContainerTop operation
type ErrContainerStatus ¶
type ErrContainerStatus struct {
ID string
Status containerd.ProcessStatus
}
ErrContainerStatus represents an error that container is in a status unexpected by the caller. E.g., remove a non-stoped/non-created container without force.
func (ErrContainerStatus) Error ¶
func (e ErrContainerStatus) Error() string