runtime

package
v0.0.0-...-cc18b97 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUUID

func NewUUID() string

NewUUID actively waits for a new UUID and returns the uuid string.

Types

type Client

type Client struct {
	Runtime runtimeapi.RuntimeServiceClient
	Image   runtimeapi.ImageServiceClient
	// contains filtered or unexported fields
}

Client is an implementation of a CRI API client.

func NewClient

func NewClient(addr string) (*Client, error)

NewClient instantiates a new API client.

func (*Client) Close

func (api *Client) Close()

func (*Client) CreateContainer

func (api *Client) CreateContainer(sandbox *runtimeapi.PodSandboxConfig, pod, name, image string, command []string) (string, error)

CreateContainer runs a container image. It returns the container ID.

func (*Client) CreateContainerWithResources

func (api *Client) CreateContainerWithResources(sandbox *runtimeapi.PodSandboxConfig, pod, name, image string, command []string, resources *runtimeapi.LinuxContainerResources) (string, error)

func (*Client) InitLinuxSandbox

func (api *Client) InitLinuxSandbox(name string) *runtimeapi.PodSandboxConfig

InitLinuxSandbox creates a new pod sandbox configuration.

func (*Client) Logs

func (api *Client) Logs(container string, writer io.Writer) error

Logs fetches the logs of the container.

func (*Client) Name

func (api *Client) Name() string

func (*Client) PullImage

func (api *Client) PullImage(image string, sandbox *runtimeapi.PodSandboxConfig) error

PullImage instructs the CRI to pull an image from a public repository.

func (*Client) RemoveContainer

func (api *Client) RemoveContainer(container string) error

RemoveContainer stops the container instance.

func (*Client) RemoveSandbox

func (api *Client) RemoveSandbox(pod string) error

RemoveSandbox stops the container instance.

func (*Client) StartContainer

func (api *Client) StartContainer(container string) error

StartContainer starts a new container instance.

func (*Client) StartSandbox

func (api *Client) StartSandbox(sandbox *runtimeapi.PodSandboxConfig, runtime string) (string, error)

StartSandbox starts up the pod sandbox. It returns the pod sandbox ID.

func (*Client) State

func (api *Client) State(container string) (runtimeapi.ContainerState, error)

State fetches the state of the container.

func (*Client) Status

func (api *Client) Status(container string) (*runtimeapi.ContainerStatus, error)

Status fetches the status of a container.

func (*Client) StopAndRemoveContainer

func (api *Client) StopAndRemoveContainer(container string) (err error)

StopAndRemoveContainer stops and removes a container.

func (*Client) StopAndRemoveSandbox

func (api *Client) StopAndRemoveSandbox(pod string) (err error)

StopAndRemoveSandbox stops and removes the given pod sandbox.

func (*Client) StopContainer

func (api *Client) StopContainer(container string, timeout int) error

StopContainer stops the container instance.

func (*Client) StopSandbox

func (api *Client) StopSandbox(pod string) error

StopSandbox stops the container instance.

func (*Client) UpdateContainerResources

func (api *Client) UpdateContainerResources(container string, resources *runtimeapi.LinuxContainerResources) error

UpdateContainerResources updates the Linux resources of the given container.

func (*Client) Version

func (api *Client) Version() string

func (*Client) WaitForLogs

func (api *Client) WaitForLogs(container string) ([]byte, error)

WaitForLogs waits for the container to exit and returns the logs as a slice of bytes.

Jump to

Keyboard shortcuts

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