Documentation ¶
Index ¶
- func NewDefaultSpec(ctx context.Context, id string) (*specs.Spec, error)
- type Client
- func (c *Client) Close() error
- func (c *Client) ContainerPID(ctx context.Context, id string) (int, error)
- func (c *Client) ContainerPIDs(ctx context.Context, id string) ([]int, error)
- func (c *Client) CreateContainer(ctx context.Context, container *Container) error
- func (c *Client) CreateSnapshot(ctx context.Context, id, ref string) error
- func (c *Client) DestroyContainer(ctx context.Context, id string, timeout int64) (*Message, error)
- func (c *Client) ExecContainer(ctx context.Context, process *Process) error
- func (c *Client) GetImageConfig(ctx context.Context, ref string) (v1.ImageConfig, error)
- func (c *Client) GetSnapshot(ctx context.Context, id string) (snapshots.Info, error)
- func (c *Client) ListImages(ctx context.Context, filter ...string) ([]types.ImageInfo, error)
- func (c *Client) PauseContainer(ctx context.Context, id string) error
- func (c *Client) ProbeContainer(ctx context.Context, id string, timeout time.Duration) *Message
- func (c *Client) PullImage(ctx context.Context, ref string, stream *jsonstream.JSONStream) (containerd.Image, error)
- func (c *Client) RecoverContainer(ctx context.Context, id string, io *containerio.IO) error
- func (c *Client) RemoveImage(ctx context.Context, ref string) error
- func (c *Client) RemoveSnapshot(ctx context.Context, id string) error
- func (c *Client) SetExitHooks(hooks ...func(string, *Message) error)
- func (c *Client) SetStopHooks(hooks ...func(string, *Message) error)
- func (c *Client) UnpauseContainer(ctx context.Context, id string) error
- func (c *Client) Version() (string, error)
- type Config
- type Container
- type Message
- type Process
- type ProgressInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Config // contains filtered or unexported fields }
Client is the client side the daemon holds to communicate with containerd.
func (*Client) ContainerPID ¶
ContainerPID returns the container's init process id.
func (*Client) ContainerPIDs ¶
ContainerPIDs returns the all processes's ids inside the container.
func (*Client) CreateContainer ¶
CreateContainer create container and start process.
func (*Client) CreateSnapshot ¶
CreateSnapshot creates a active snapshot with image's name and id.
func (*Client) DestroyContainer ¶
DestroyContainer kill container and delete it.
func (*Client) ExecContainer ¶
ExecContainer executes a process in container.
func (*Client) GetImageConfig ¶
GetImageConfig returns the image's configure.
func (*Client) GetSnapshot ¶
GetSnapshot returns the snapshot's info by id.
func (*Client) ListImages ¶
ListImages lists all images.
func (*Client) PauseContainer ¶
PauseContainer pause container.
func (*Client) ProbeContainer ¶
ProbeContainer probe the container's status, if timeout <= 0, will block to receive message.
func (*Client) PullImage ¶
func (c *Client) PullImage(ctx context.Context, ref string, stream *jsonstream.JSONStream) (containerd.Image, error)
PullImage downloads an image from the remote repository.
func (*Client) RecoverContainer ¶
RecoverContainer reload the container from metadata and watch it, if program be restarted.
func (*Client) RemoveImage ¶
RemoveImage deletes an image.
func (*Client) RemoveSnapshot ¶
RemoveSnapshot removes the snapshot by id.
func (*Client) SetExitHooks ¶
SetExitHooks specified the handlers of exec process exit.
func (*Client) SetStopHooks ¶
SetStopHooks specified the handlers of container exit.
func (*Client) UnpauseContainer ¶
UnpauseContainer unpauses a container.
type Config ¶
type Config struct {
Address string
}
Config represents the config used to communicated with containerd.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is used to watch containerd.