Documentation ¶
Overview ¶
* Copyright 1999-2020 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
* Copyright 1999-2020 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
Index ¶
- Constants
- type Client
- func (c *Client) CopyToContainer(ctx context.Context, containerId, srcFile, dstPath, extractDirName string, ...) error
- func (c *Client) ExecContainer(ctx context.Context, containerId, command string) (output string, err error)
- func (c *Client) ExecuteAndRemove(ctx context.Context, config *containertype.Config, ...) (containerId string, output string, err error, code int32)
- func (c *Client) GetContainerById(ctx context.Context, containerId string) (container.ContainerInfo, error, int32)
- func (c *Client) GetContainerByLabelSelector(labels map[string]string) (container.ContainerInfo, error, int32)
- func (c *Client) GetContainerByName(ctx context.Context, containerName string) (container.ContainerInfo, error, int32)
- func (c *Client) GetPidById(ctx context.Context, containerId string) (int32, error, int32)
- func (c *Client) NewTask(imageRef string, cntr containerd.Container) (containerd.Task, error)
- func (c *Client) RemoveContainer(ctx context.Context, containerId string, force bool) error
- func (c *Client) Spec(ci container.ContainerInfo) (*oci.Spec, error)
Constants ¶
const ( DefaultStateDir = "/run/containerd" // DefaultAddress is the default unix socket address DefaultUinxAddress = DefaultStateDir + "/containerd.sock" DefaultRuntime = "io.containerd.runc.v2" DefaultSnapshotter = "overlayfs" DefaultContainerdNS = "k8s.io" NetworkNsType = "network" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Ctx context.Context Cancel context.CancelFunc // contains filtered or unexported fields }
func (*Client) CopyToContainer ¶
func (*Client) ExecContainer ¶
func (*Client) ExecuteAndRemove ¶
func (c *Client) ExecuteAndRemove(ctx context.Context, config *containertype.Config, hostConfig *containertype.HostConfig, networkConfig *network.NetworkingConfig, containerName string, removed bool, timeout time.Duration, command string, containerInfo container.ContainerInfo) (containerId string, output string, err error, code int32)
ExecuteAndRemove: create and start a container for executing a command, and remove the container
func (*Client) GetContainerById ¶
func (*Client) GetContainerByLabelSelector ¶
func (*Client) GetContainerByName ¶
func (*Client) GetPidById ¶
func (*Client) NewTask ¶
func (c *Client) NewTask(imageRef string, cntr containerd.Container) (containerd.Task, error)