client

package
v0.0.0-...-058fe0e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClient

type APIClient struct {
	HTTPCli *http.Client
	// contains filtered or unexported fields
}

APIClient is a API client that performs all operations against a pouch server

func NewAPIClient

func NewAPIClient(host string, tls utils.TLSConfig) (*APIClient, error)

NewAPIClient initializes a new API client for the given host

func (*APIClient) BaseURL

func (client *APIClient) BaseURL() string

BaseURL returns the base URL of APIClient

func (*APIClient) ContainerAttach

func (client *APIClient) ContainerAttach(name string, stdin bool) (net.Conn, *bufio.Reader, error)

ContainerAttach attach a container

func (*APIClient) ContainerCreate

func (client *APIClient) ContainerCreate(config types.ContainerConfig, hostConfig *types.HostConfig, containerName string) (*types.ContainerCreateResp, error)

ContainerCreate creates a new container based in the given configuration.

func (*APIClient) ContainerCreateExec

func (client *APIClient) ContainerCreateExec(name string, config *types.ExecCreateConfig) (*types.ExecCreateResp, error)

ContainerCreateExec creates exec process.

func (*APIClient) ContainerGet

func (client *APIClient) ContainerGet(name string) (*types.ContainerJSON, error)

ContainerGet returns the detailed information of container.

func (*APIClient) ContainerList

func (client *APIClient) ContainerList(all bool) ([]*types.Container, error)

ContainerList returns the list of containers.

func (*APIClient) ContainerPause

func (client *APIClient) ContainerPause(name string) error

ContainerPause pauses a container

func (*APIClient) ContainerRemove

func (client *APIClient) ContainerRemove(name string, force bool) error

ContainerRemove removes a container.

func (*APIClient) ContainerRename

func (client *APIClient) ContainerRename(id string, name string) error

ContainerRename renames a container.

func (*APIClient) ContainerStart

func (client *APIClient) ContainerStart(name, detachKeys string) error

ContainerStart starts a created container.

func (*APIClient) ContainerStartExec

func (client *APIClient) ContainerStartExec(execid string, config *types.ExecStartConfig) (net.Conn, *bufio.Reader, error)

ContainerStartExec starts exec process.

func (*APIClient) ContainerStop

func (client *APIClient) ContainerStop(name string, timeout string) error

ContainerStop stops a container.

func (*APIClient) ContainerUnpause

func (client *APIClient) ContainerUnpause(name string) error

ContainerUnpause unpauses a container

func (*APIClient) ImageInspect

func (client *APIClient) ImageInspect(name string) (types.ImageInfo, error)

ImageInspect requests daemon to inspect an image.

func (*APIClient) ImageList

func (client *APIClient) ImageList() ([]types.ImageInfo, error)

ImageList requests daemon to list all images

func (*APIClient) ImagePull

func (client *APIClient) ImagePull(name, tag string) (io.ReadCloser, error)

ImagePull requests daemon to pull an image from registry.

func (*APIClient) ImageRemove

func (client *APIClient) ImageRemove(name string, force bool) error

ImageRemove deletes an image.

func (*APIClient) NetworkCreate

func (client *APIClient) NetworkCreate(req *types.NetworkCreateConfig) (*types.NetworkCreateResp, error)

NetworkCreate creates a network.

func (*APIClient) SystemInfo

func (client *APIClient) SystemInfo() (*types.SystemInfo, error)

SystemInfo requests daemon for system info.

func (*APIClient) SystemPing

func (client *APIClient) SystemPing() (string, error)

SystemPing shows whether server is ok.

func (*APIClient) SystemVersion

func (client *APIClient) SystemVersion() (*types.SystemVersion, error)

SystemVersion requests daemon for system version.

func (*APIClient) VolumeCreate

func (client *APIClient) VolumeCreate(config *types.VolumeCreateConfig) (*types.VolumeInfo, error)

VolumeCreate creates a volume

func (*APIClient) VolumeRemove

func (client *APIClient) VolumeRemove(name string) error

VolumeRemove removes a volume

type ContainerAPIClient

type ContainerAPIClient interface {
	ContainerCreate(config types.ContainerConfig, hostConfig *types.HostConfig, containerName string) (*types.ContainerCreateResp, error)
	ContainerStart(name, detachKeys string) error
	ContainerStop(name, timeout string) error
	ContainerRemove(name string, force bool) error
	ContainerList(all bool) ([]*types.Container, error)
	ContainerAttach(name string, stdin bool) (net.Conn, *bufio.Reader, error)
	ContainerCreateExec(name string, config *types.ExecCreateConfig) (*types.ExecCreateResp, error)
	ContainerStartExec(execid string, config *types.ExecStartConfig) (net.Conn, *bufio.Reader, error)
	ContainerGet(name string) (*types.ContainerJSON, error)
	ContainerRename(id string, name string) error
	ContainerPause(name string) error
}

ContainerAPIClient defines methods of Container client.

type ImageAPIClient

type ImageAPIClient interface {
	ImageList() ([]types.ImageInfo, error)
	ImageInspect(name string) (types.ImageInfo, error)
	ImagePull(name, tag string) (io.ReadCloser, error)
	ImageRemove(name string, force bool) error
}

ImageAPIClient defines methods of Image client.

type RespError

type RespError struct {
	// contains filtered or unexported fields
}

RespError defines the response error.

func (RespError) Error

func (e RespError) Error() string

Error implements the error interface.

type Response

type Response struct {
	StatusCode int
	Status     string
	Body       io.ReadCloser
}

Response wraps the http.Response and other states.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL