client

package
v0.0.0-...-adb5aae Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrHTTPNotfound represents the 404 error of a http request.
	ErrHTTPNotfound = RespError{codeHTTPNotfound, "404: not found"}
)

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) ContainerList

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

ContainerList returns the list of containers.

func (*APIClient) ContainerStart

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

ContainerStart starts a created container.

func (*APIClient) ContainerStop

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

ContainerStop stops a container

func (*APIClient) ImageList

func (client *APIClient) ImageList() ([]types.Image, 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) 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 weather 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(req *types.VolumeCreateRequest) (*types.VolumeInfo, error)

VolumeCreate creates a volume

func (*APIClient) VolumeRemove

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

VolumeRemove removes a volume

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