Documentation ¶
Index ¶
- type APIClient
- func (client *APIClient) BaseURL() string
- func (client *APIClient) ContainerAttach(ctx context.Context, name string, stdin bool) (net.Conn, *bufio.Reader, error)
- func (client *APIClient) ContainerCreate(ctx context.Context, config types.ContainerConfig, ...) (*types.ContainerCreateResp, error)
- func (client *APIClient) ContainerCreateExec(ctx context.Context, name string, config *types.ExecCreateConfig) (*types.ExecCreateResp, error)
- func (client *APIClient) ContainerExecInspect(ctx context.Context, execid string) (*types.ContainerExecInspect, error)
- func (client *APIClient) ContainerGet(ctx context.Context, name string) (*types.ContainerJSON, error)
- func (client *APIClient) ContainerList(ctx context.Context, all bool) ([]*types.Container, error)
- func (client *APIClient) ContainerLogs(ctx context.Context, name string, options types.ContainerLogsOptions) (io.ReadCloser, error)
- func (client *APIClient) ContainerPause(ctx context.Context, name string) error
- func (client *APIClient) ContainerRemove(ctx context.Context, name string, options *types.ContainerRemoveOptions) error
- func (client *APIClient) ContainerRename(ctx context.Context, id string, name string) error
- func (client *APIClient) ContainerResize(ctx context.Context, name, height, width string) error
- func (client *APIClient) ContainerRestart(ctx context.Context, name string, timeout string) error
- func (client *APIClient) ContainerStart(ctx context.Context, name, detachKeys string) error
- func (client *APIClient) ContainerStartExec(ctx context.Context, execid string, config *types.ExecStartConfig) (net.Conn, *bufio.Reader, error)
- func (client *APIClient) ContainerStop(ctx context.Context, name string, timeout string) error
- func (client *APIClient) ContainerTop(ctx context.Context, name string, arguments []string) (types.ContainerProcessList, error)
- func (client *APIClient) ContainerUnpause(ctx context.Context, name string) error
- func (client *APIClient) ContainerUpdate(ctx context.Context, name string, config *types.UpdateConfig) error
- func (client *APIClient) ContainerUpgrade(ctx context.Context, name string, config types.ContainerConfig, ...) error
- func (client *APIClient) ContainerWait(ctx context.Context, name string) (types.ContainerWaitOKBody, error)
- func (client *APIClient) GetAPIPath(path string, query url.Values) string
- func (client *APIClient) ImageInspect(ctx context.Context, name string) (types.ImageInfo, error)
- func (client *APIClient) ImageList(ctx context.Context) ([]types.ImageInfo, error)
- func (client *APIClient) ImageLoad(ctx context.Context, imageName string, reader io.Reader) error
- func (client *APIClient) ImagePull(ctx context.Context, name, tag, encodedAuth string) (io.ReadCloser, error)
- func (client *APIClient) ImageRemove(ctx context.Context, name string, force bool) error
- func (client *APIClient) ImageTag(ctx context.Context, image string, tag string) error
- func (client *APIClient) NetworkConnect(ctx context.Context, network string, req *types.NetworkConnect) error
- func (client *APIClient) NetworkCreate(ctx context.Context, req *types.NetworkCreateConfig) (*types.NetworkCreateResp, error)
- func (client *APIClient) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error
- func (client *APIClient) NetworkInspect(ctx context.Context, networkID string) (*types.NetworkInspectResp, error)
- func (client *APIClient) NetworkList(ctx context.Context) ([]types.NetworkResource, error)
- func (client *APIClient) NetworkRemove(ctx context.Context, networkID string) error
- func (client *APIClient) RegistryLogin(ctx context.Context, auth *types.AuthConfig) (*types.AuthResponse, error)
- func (client *APIClient) SystemInfo(ctx context.Context) (*types.SystemInfo, error)
- func (client *APIClient) SystemPing(ctx context.Context) (string, error)
- func (client *APIClient) SystemVersion(ctx context.Context) (*types.SystemVersion, error)
- func (client *APIClient) UpdateClientVersion(v string)
- func (client *APIClient) VolumeCreate(ctx context.Context, config *types.VolumeCreateConfig) (*types.VolumeInfo, error)
- func (client *APIClient) VolumeInspect(ctx context.Context, name string) (*types.VolumeInfo, error)
- func (client *APIClient) VolumeList(ctx context.Context) (*types.VolumeListResp, error)
- func (client *APIClient) VolumeRemove(ctx context.Context, name string) error
- type CommonAPIClient
- type ContainerAPIClient
- type ImageAPIClient
- type NetworkAPIClient
- type RespError
- type Response
- type SystemAPIClient
- type TLSConfig
- type VolumeAPIClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
APIClient is a API client that performs all operations against a pouch server
func (*APIClient) ContainerAttach ¶
func (client *APIClient) ContainerAttach(ctx context.Context, name string, stdin bool) (net.Conn, *bufio.Reader, error)
ContainerAttach attachs a container.
func (*APIClient) ContainerCreate ¶
func (client *APIClient) ContainerCreate(ctx context.Context, config types.ContainerConfig, hostConfig *types.HostConfig, networkingConfig *types.NetworkingConfig, containerName string) (*types.ContainerCreateResp, error)
ContainerCreate creates a new container based in the given configuration.
func (*APIClient) ContainerCreateExec ¶
func (client *APIClient) ContainerCreateExec(ctx context.Context, name string, config *types.ExecCreateConfig) (*types.ExecCreateResp, error)
ContainerCreateExec creates exec process.
func (*APIClient) ContainerExecInspect ¶
func (client *APIClient) ContainerExecInspect(ctx context.Context, execid string) (*types.ContainerExecInspect, error)
ContainerExecInspect get exec info with a specified exec id.
func (*APIClient) ContainerGet ¶
func (client *APIClient) ContainerGet(ctx context.Context, name string) (*types.ContainerJSON, error)
ContainerGet returns the detailed information of container.
func (*APIClient) ContainerList ¶
ContainerList returns the list of containers.
func (*APIClient) ContainerLogs ¶
func (client *APIClient) ContainerLogs(ctx context.Context, name string, options types.ContainerLogsOptions) (io.ReadCloser, error)
ContainerLogs return the logs generated by a container in an io.ReadCloser.
func (*APIClient) ContainerPause ¶
ContainerPause pauses a container.
func (*APIClient) ContainerRemove ¶
func (client *APIClient) ContainerRemove(ctx context.Context, name string, options *types.ContainerRemoveOptions) error
ContainerRemove removes a container.
func (*APIClient) ContainerRename ¶
ContainerRename renames a container.
func (*APIClient) ContainerResize ¶
ContainerResize resizes the size of container tty.
func (*APIClient) ContainerRestart ¶
ContainerRestart restarts a running container.
func (*APIClient) ContainerStart ¶
ContainerStart starts a created container.
func (*APIClient) ContainerStartExec ¶
func (client *APIClient) ContainerStartExec(ctx context.Context, execid string, config *types.ExecStartConfig) (net.Conn, *bufio.Reader, error)
ContainerStartExec starts exec process.
func (*APIClient) ContainerStop ¶
ContainerStop stops a container.
func (*APIClient) ContainerTop ¶
func (client *APIClient) ContainerTop(ctx context.Context, name string, arguments []string) (types.ContainerProcessList, error)
ContainerTop shows process information from within a container.
func (*APIClient) ContainerUnpause ¶
ContainerUnpause unpauses a container.
func (*APIClient) ContainerUpdate ¶
func (client *APIClient) ContainerUpdate(ctx context.Context, name string, config *types.UpdateConfig) error
ContainerUpdate updates the configurations of a container.
func (*APIClient) ContainerUpgrade ¶
func (client *APIClient) ContainerUpgrade(ctx context.Context, name string, config types.ContainerConfig, hostConfig *types.HostConfig) error
ContainerUpgrade upgrade a container with new image and args.
func (*APIClient) ContainerWait ¶
func (client *APIClient) ContainerWait(ctx context.Context, name string) (types.ContainerWaitOKBody, error)
ContainerWait pauses execution until a container exits. It returns the API status code as response of its readiness.
func (*APIClient) GetAPIPath ¶
GetAPIPath returns the versioned request path to call the api. It appends the query parameters to the path if they are not empty.
func (*APIClient) ImageInspect ¶
ImageInspect requests daemon to inspect an image.
func (*APIClient) ImagePull ¶
func (client *APIClient) ImagePull(ctx context.Context, name, tag, encodedAuth string) (io.ReadCloser, error)
ImagePull requests daemon to pull an image from registry.
func (*APIClient) ImageRemove ¶
ImageRemove deletes an image.
func (*APIClient) NetworkConnect ¶
func (client *APIClient) NetworkConnect(ctx context.Context, network string, req *types.NetworkConnect) error
NetworkConnect connects a container to a network.
func (*APIClient) NetworkCreate ¶
func (client *APIClient) NetworkCreate(ctx context.Context, req *types.NetworkCreateConfig) (*types.NetworkCreateResp, error)
NetworkCreate creates a network.
func (*APIClient) NetworkDisconnect ¶
func (client *APIClient) NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error
NetworkDisconnect disconnect a network from a container.
func (*APIClient) NetworkInspect ¶
func (client *APIClient) NetworkInspect(ctx context.Context, networkID string) (*types.NetworkInspectResp, error)
NetworkInspect inspects a network.
func (*APIClient) NetworkList ¶
NetworkList lists all the networks.
func (*APIClient) NetworkRemove ¶
NetworkRemove removes a network.
func (*APIClient) RegistryLogin ¶
func (client *APIClient) RegistryLogin(ctx context.Context, auth *types.AuthConfig) (*types.AuthResponse, error)
RegistryLogin authenticates the server with a given registry to login.
func (*APIClient) SystemInfo ¶
SystemInfo requests daemon for system info.
func (*APIClient) SystemPing ¶
SystemPing shows whether server is ok.
func (*APIClient) SystemVersion ¶
SystemVersion requests daemon for system version.
func (*APIClient) UpdateClientVersion ¶
UpdateClientVersion sets client version new value.
func (*APIClient) VolumeCreate ¶
func (client *APIClient) VolumeCreate(ctx context.Context, config *types.VolumeCreateConfig) (*types.VolumeInfo, error)
VolumeCreate creates a volume.
func (*APIClient) VolumeInspect ¶
VolumeInspect inspects a volume.
func (*APIClient) VolumeList ¶
VolumeList returns the list of volumes.
type CommonAPIClient ¶
type CommonAPIClient interface { ContainerAPIClient ImageAPIClient VolumeAPIClient SystemAPIClient NetworkAPIClient }
CommonAPIClient defines common methods of api client
func NewAPIClient ¶
func NewAPIClient(host string, tls TLSConfig) (CommonAPIClient, error)
NewAPIClient initializes a new API client for the given host
type ContainerAPIClient ¶
type ContainerAPIClient interface { ContainerCreate(ctx context.Context, config types.ContainerConfig, hostConfig *types.HostConfig, networkConfig *types.NetworkingConfig, containerName string) (*types.ContainerCreateResp, error) ContainerStart(ctx context.Context, name, detachKeys string) error ContainerStop(ctx context.Context, name, timeout string) error ContainerRemove(ctx context.Context, name string, options *types.ContainerRemoveOptions) error ContainerList(ctx context.Context, all bool) ([]*types.Container, error) ContainerAttach(ctx context.Context, name string, stdin bool) (net.Conn, *bufio.Reader, error) ContainerCreateExec(ctx context.Context, name string, config *types.ExecCreateConfig) (*types.ExecCreateResp, error) ContainerStartExec(ctx context.Context, execid string, config *types.ExecStartConfig) (net.Conn, *bufio.Reader, error) ContainerExecInspect(ctx context.Context, execid string) (*types.ContainerExecInspect, error) ContainerGet(ctx context.Context, name string) (*types.ContainerJSON, error) ContainerRename(ctx context.Context, id string, name string) error ContainerRestart(ctx context.Context, name string, timeout string) error ContainerPause(ctx context.Context, name string) error ContainerUnpause(ctx context.Context, name string) error ContainerUpdate(ctx context.Context, name string, config *types.UpdateConfig) error ContainerUpgrade(ctx context.Context, name string, config types.ContainerConfig, hostConfig *types.HostConfig) error ContainerTop(ctx context.Context, name string, arguments []string) (types.ContainerProcessList, error) ContainerLogs(ctx context.Context, name string, options types.ContainerLogsOptions) (io.ReadCloser, error) ContainerResize(ctx context.Context, name, height, width string) error ContainerWait(ctx context.Context, name string) (types.ContainerWaitOKBody, error) }
ContainerAPIClient defines methods of Container client.
type ImageAPIClient ¶
type ImageAPIClient interface { ImageList(ctx context.Context) ([]types.ImageInfo, error) ImageInspect(ctx context.Context, name string) (types.ImageInfo, error) ImagePull(ctx context.Context, name, tag, encodedAuth string) (io.ReadCloser, error) ImageRemove(ctx context.Context, name string, force bool) error ImageTag(ctx context.Context, image string, tag string) error ImageLoad(ctx context.Context, name string, r io.Reader) error }
ImageAPIClient defines methods of Image client.
type NetworkAPIClient ¶
type NetworkAPIClient interface { NetworkCreate(ctx context.Context, req *types.NetworkCreateConfig) (*types.NetworkCreateResp, error) NetworkRemove(ctx context.Context, networkID string) error NetworkInspect(ctx context.Context, networkID string) (*types.NetworkInspectResp, error) NetworkList(ctx context.Context) ([]types.NetworkResource, error) NetworkConnect(ctx context.Context, network string, req *types.NetworkConnect) error NetworkDisconnect(ctx context.Context, networkID, containerID string, force bool) error }
NetworkAPIClient defines methods of Network client.
type RespError ¶
type RespError struct {
// contains filtered or unexported fields
}
RespError defines the response error.
type Response ¶
type Response struct { StatusCode int Status string Body io.ReadCloser }
Response wraps the http.Response and other states.
type SystemAPIClient ¶
type SystemAPIClient interface { SystemPing(ctx context.Context) (string, error) SystemVersion(ctx context.Context) (*types.SystemVersion, error) SystemInfo(ctx context.Context) (*types.SystemInfo, error) RegistryLogin(ctx context.Context, auth *types.AuthConfig) (*types.AuthResponse, error) }
SystemAPIClient defines methods of System client.
type TLSConfig ¶
type TLSConfig struct { CA string `json:"tlscacert,omitempty"` Cert string `json:"tlscert,omitempty"` Key string `json:"tlskey,omitempty"` VerifyRemote bool `json:"tlsverify"` ManagerWhiteList string `json:"manager-whitelist"` }
TLSConfig contains information of tls which users can specify
type VolumeAPIClient ¶
type VolumeAPIClient interface { VolumeCreate(ctx context.Context, config *types.VolumeCreateConfig) (*types.VolumeInfo, error) VolumeRemove(ctx context.Context, name string) error VolumeInspect(ctx context.Context, name string) (*types.VolumeInfo, error) VolumeList(ctx context.Context) (*types.VolumeListResp, error) }
VolumeAPIClient defines methods of Volume client.
Source Files ¶
- client.go
- container_attach.go
- container_create.go
- container_exec.go
- container_get.go
- container_list.go
- container_logs.go
- container_pause.go
- container_remove.go
- container_rename.go
- container_resize.go
- container_restart.go
- container_start.go
- container_stop.go
- container_top.go
- container_unpause.go
- container_update.go
- container_upgrade.go
- container_wait.go
- image_inspect.go
- image_list.go
- image_load.go
- image_pull.go
- image_remove.go
- image_tag.go
- interface.go
- network_connect.go
- network_create.go
- network_disconnect.go
- network_inspect.go
- network_list.go
- network_remove.go
- registry_login.go
- request.go
- system_info.go
- system_ping.go
- system_version.go
- utils.go
- volume_create.go
- volume_inspect.go
- volume_list.go
- volume_remove.go