Documentation ¶
Index ¶
- type CRIClient
- type ContainerdClient
- func (c ContainerdClient) ContainerKillByContainerID(ctx context.Context, containerID string) error
- func (c ContainerdClient) FormatContainerID(ctx context.Context, containerID string) (string, error)
- func (c ContainerdClient) GetPidFromContainerID(ctx context.Context, containerID string) (uint32, error)
- type ContainerdClientInterface
- type DockerClient
- type DockerClientInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CRIClient ¶
type CRIClient interface { GetPidFromContainerID(ctx context.Context, containerID string) (uint32, error) ContainerKillByContainerID(ctx context.Context, containerID string) error FormatContainerID(ctx context.Context, containerID string) (string, error) }
CRIClient represents a struct which can give you information about container runtime
type ContainerdClient ¶
type ContainerdClient struct {
// contains filtered or unexported fields
}
ContainerdClient can get information from containerd
func (ContainerdClient) ContainerKillByContainerID ¶
func (c ContainerdClient) ContainerKillByContainerID(ctx context.Context, containerID string) error
ContainerKillByContainerID kills container according to container id
func (ContainerdClient) FormatContainerID ¶
func (c ContainerdClient) FormatContainerID(ctx context.Context, containerID string) (string, error)
FormatContainerID strips protocol prefix from the container ID
func (ContainerdClient) GetPidFromContainerID ¶
func (c ContainerdClient) GetPidFromContainerID(ctx context.Context, containerID string) (uint32, error)
GetPidFromContainerID fetches PID according to container id
type ContainerdClientInterface ¶
type ContainerdClientInterface interface {
LoadContainer(ctx context.Context, id string) (containerd.Container, error)
}
ContainerdClientInterface represents the ContainerClient, it's used to simply unit test
type DockerClient ¶
type DockerClient struct {
// contains filtered or unexported fields
}
DockerClient can get information from docker
func (DockerClient) ContainerKillByContainerID ¶
func (c DockerClient) ContainerKillByContainerID(ctx context.Context, containerID string) error
ContainerKillByContainerID kills container according to container id
func (DockerClient) FormatContainerID ¶
FormatContainerID strips protocol prefix from the container ID
func (DockerClient) GetPidFromContainerID ¶
func (c DockerClient) GetPidFromContainerID(ctx context.Context, containerID string) (uint32, error)
GetPidFromContainerID fetches PID according to container id
type DockerClientInterface ¶
type DockerClientInterface interface { ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) ContainerKill(ctx context.Context, containerID, signal string) error }
DockerClientInterface represents the DockerClient, it's used to simply unit test