Documentation
¶
Index ¶
- func GenTLSConfig(key, cert, ca string) (*tls.Config, error)
- 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) 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, force bool) 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) 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) 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) NetworkCreate(ctx context.Context, req *types.NetworkCreateConfig) (*types.NetworkCreateResp, error)
- func (client *APIClient) NetworkInspect(ctx context.Context, networkID string) (*types.NetworkInspectResp, error)
- func (client *APIClient) NetworkList(ctx context.Context) (*types.NetworkListResp, 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 ¶
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 attach 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) 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 ¶
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) 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) NetworkCreate ¶
func (client *APIClient) NetworkCreate(ctx context.Context, req *types.NetworkCreateConfig) (*types.NetworkCreateResp, error)
NetworkCreate creates a network.
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, force bool) 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) 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 }
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 }
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.NetworkListResp, 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.go
- container_create.go
- container_get.go
- container_list.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
- image_inspect.go
- image_list.go
- image_pull.go
- image_remove.go
- interface.go
- network_create.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