Documentation ¶
Overview ¶
Package cri provides minimal CRI client
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) ContainerStats(ctx context.Context, containerID string) (*runtimeapi.ContainerStats, error)
- func (c *Client) ContainerStatus(ctx context.Context, containerID string, verbose bool) (*runtimeapi.ContainerStatus, map[string]string, error)
- func (c *Client) CreateContainer(ctx context.Context, podSandBoxID string, config *runtimeapi.ContainerConfig, ...) (string, error)
- func (c *Client) ImageStatus(ctx context.Context, image *runtimeapi.ImageSpec) (*runtimeapi.Image, error)
- func (c *Client) ListContainerStats(ctx context.Context, filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error)
- func (c *Client) ListContainers(ctx context.Context, filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
- func (c *Client) ListImages(ctx context.Context, filter *runtimeapi.ImageFilter) ([]*runtimeapi.Image, error)
- func (c *Client) ListPodSandbox(ctx context.Context, filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)
- func (c *Client) PodSandboxStatus(ctx context.Context, podSandBoxID string) (*runtimeapi.PodSandboxStatus, map[string]string, error)
- func (c *Client) PullImage(ctx context.Context, image *runtimeapi.ImageSpec, ...) (string, error)
- func (c *Client) RemoveContainer(ctx context.Context, containerID string) error
- func (c *Client) RemovePodSandbox(ctx context.Context, podSandBoxID string) error
- func (c *Client) RunPodSandbox(ctx context.Context, config *runtimeapi.PodSandboxConfig, ...) (string, error)
- func (c *Client) StartContainer(ctx context.Context, containerID string) error
- func (c *Client) StopContainer(ctx context.Context, containerID string, timeout int64) error
- func (c *Client) StopPodSandbox(ctx context.Context, podSandBoxID string) error
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 is a lightweight implementation of CRI client.
func (*Client) ContainerStats ¶
func (c *Client) ContainerStats(ctx context.Context, containerID string) (*runtimeapi.ContainerStats, error)
ContainerStats returns the stats of the container.
func (*Client) ContainerStatus ¶
func (c *Client) ContainerStatus(ctx context.Context, containerID string, verbose bool) (*runtimeapi.ContainerStatus, map[string]string, error)
ContainerStatus returns the container status.
func (*Client) CreateContainer ¶
func (c *Client) CreateContainer(ctx context.Context, podSandBoxID string, config *runtimeapi.ContainerConfig, sandboxConfig *runtimeapi.PodSandboxConfig) (string, error)
CreateContainer creates a new container in the specified PodSandbox.
func (*Client) ImageStatus ¶
func (c *Client) ImageStatus(ctx context.Context, image *runtimeapi.ImageSpec) (*runtimeapi.Image, error)
ImageStatus returns the status of the image.
func (*Client) ListContainerStats ¶
func (c *Client) ListContainerStats(ctx context.Context, filter *runtimeapi.ContainerStatsFilter) ([]*runtimeapi.ContainerStats, error)
ListContainerStats returns stats for all the containers matching the filter
func (*Client) ListContainers ¶
func (c *Client) ListContainers(ctx context.Context, filter *runtimeapi.ContainerFilter) ([]*runtimeapi.Container, error)
ListContainers lists containers by filters.
func (*Client) ListImages ¶
func (c *Client) ListImages(ctx context.Context, filter *runtimeapi.ImageFilter) ([]*runtimeapi.Image, error)
ListImages lists available images
func (*Client) ListPodSandbox ¶
func (c *Client) ListPodSandbox(ctx context.Context, filter *runtimeapi.PodSandboxFilter) ([]*runtimeapi.PodSandbox, error)
ListPodSandbox returns a list of PodSandboxes.
func (*Client) PodSandboxStatus ¶
func (c *Client) PodSandboxStatus(ctx context.Context, podSandBoxID string) (*runtimeapi.PodSandboxStatus, map[string]string, error)
PodSandboxStatus returns the status of the PodSandbox.
func (*Client) PullImage ¶
func (c *Client) PullImage(ctx context.Context, image *runtimeapi.ImageSpec, sandboxConfig *runtimeapi.PodSandboxConfig) (string, error)
PullImage pulls container image
func (*Client) RemoveContainer ¶
RemoveContainer removes the container. If the container is running, the container should be forced to removal.
func (*Client) RemovePodSandbox ¶
RemovePodSandbox removes the sandbox. If there are any containers in the sandbox, they should be forcibly removed.
func (*Client) RunPodSandbox ¶
func (c *Client) RunPodSandbox(ctx context.Context, config *runtimeapi.PodSandboxConfig, runtimeHandler string) (string, error)
RunPodSandbox creates and starts a pod-level sandbox. Runtimes should ensure the sandbox is in ready state.
func (*Client) StartContainer ¶
StartContainer starts the container.
func (*Client) StopContainer ¶
StopContainer stops a running container with a grace period (i.e., timeout).