package client

import "github.com/containerd/containerd/runtime/v1/shim/client"

Index

Functions

func WithLocal

func WithLocal(publisher events.Publisher) func(context.Context, shim.Config) (shimapi.ShimService, io.Closer, error)

WithLocal uses an in process shim

Types

type Client

type Client struct {
	shimapi.ShimService
	// contains filtered or unexported fields
}

Client is a shim client containing the connection to a shim

func New

func New(ctx context.Context, config shim.Config, opt Opt) (*Client, error)

New returns a new shim client

func (*Client) Close

func (c *Client) Close() error

Close the client connection

func (*Client) IsAlive

func (c *Client) IsAlive(ctx context.Context) (bool, error)

IsAlive returns true if the shim can be contacted. NOTE: a negative answer doesn't mean that the process is gone.

func (*Client) KillShim

func (c *Client) KillShim(ctx context.Context) error

KillShim kills the shim forcefully and wait for the process to disappear

func (*Client) StopShim

func (c *Client) StopShim(ctx context.Context) error

StopShim signals the shim to exit and wait for the process to disappear

type Opt

Opt is an option for a shim client configuration

func WithConnect

func WithConnect(address string, onClose func()) Opt

WithConnect connects to an existing shim

func WithStart

func WithStart(binary, address, daemonAddress, cgroup string, debug bool, exitHandler func()) Opt

WithStart executes a new shim process

Source Files

client.go client_unix.go

Version
v1.4.0-beta.1
Published
May 28, 2020
Platform
js/wasm
Imports
24 packages
Last checked
1 minute ago

Tools for package owners.