Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateID() string
- func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)
- func GetContainerdConfig(path string) (*srvconfig.Config, error)
- func WaitContainerdReady() error
- type Client
- func (c *Client) Close()
- func (c *Client) ContainerList(filters ...string) ([]containerd.Container, error)
- func (c *Client) Delete(name string) error
- func (c *Client) EnsureContainerRun(containerId string) (bool, error)
- func (c *Client) EnsureImageExists(image ImageRef) error
- func (c *Client) Ping() error
- func (c *Client) Pull(image ImageRef) error
- func (c *Client) Run(cs ContainerSpec) error
- func (c *Client) Stop(id string) error
- type ContainerSpec
- type ContainerdClient
- type ImageRef
Constants ¶
View Source
const ContainerdConfigFilePath = "/etc/containerd/config.toml"
View Source
const (
// IDLength specifies the length of the hexadecimal string ID
IDLength = 64
)
Variables ¶
View Source
var ( // Timeout of connecting to server (default: 10s) Timeout = 10 * time.Second )
Functions ¶
func GenerateID ¶
func GenerateID() string
GenerateID creates a secure random hexadecimal string of IDLength characters
func GetAddressAndDialer ¶
func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)
GetAddressAndDialer returns the address parsed from the given endpoint and a context dialer.
func WaitContainerdReady ¶
func WaitContainerdReady() error
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ContainerList ¶
func (c *Client) ContainerList(filters ...string) ([]containerd.Container, error)
func (*Client) EnsureContainerRun ¶
func (*Client) EnsureImageExists ¶
func (*Client) Run ¶
func (c *Client) Run(cs ContainerSpec) error
type ContainerSpec ¶
type ContainerdClient ¶
type ContainerdClient interface {
Pull(Image ImageRef) error
//Push(Image ImageRef) (readClose io.ReadCloser, err error)
Close()
Stop(containerId string) error
Delete(containerId string) error
Run(cs ContainerSpec) error
EnsureImageExists(image ImageRef) error
EnsureContainerRun(containerId string) (bool, error)
ContainerList(filters ...string) ([]containerd.Container, error)
Ping() error
}
func NewContainedClient ¶
func NewContainedClient() (ContainerdClient, error)
Click to show internal directories.
Click to hide internal directories.