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 ¶
- 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) GetContainerFromDocker(option types.ContainerListOptions) (container.ContainerInfo, error, int32)
- func (c *Client) GetPidById(ctx context.Context, containerId string) (int32, error, int32)
- func (c *Client) RemoveContainer(ctx context.Context, containerId string, force bool) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) CopyToContainer ¶
func (c *Client) CopyToContainer(ctx context.Context, containerId, srcFile, dstPath, extractDirName string, override bool) error
CopyToContainer copies a tar file to the dstPath. If the same file exits in the dstPath, it will be override if the override arg is true, otherwise not
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 (c *Client) GetContainerByName(ctx context.Context, containerName string) (container.ContainerInfo, error, int32)
getContainerByName returns the container object by container name
func (*Client) GetContainerFromDocker ¶
func (c *Client) GetContainerFromDocker(option types.ContainerListOptions) (container.ContainerInfo, error, int32)