{"modulePath":"github.com/ripta/engine-api","version":"v0.2.3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\n## Variables\n\n```go\nvar ErrConnectionFailed = errors.New(\"Cannot connect to the Docker daemon. Is the docker daemon running on this host?\")\n```\nErrConnectionFailed is a error raised when the connection between the client and the server failed.\n\n## Functions\n\n```go\nfunc IsErrContainerNotFound(err error) bool\n```\nIsErrContainerNotFound returns true if the error is caused when a container is not found in the docker host.\n\n```go\nfunc IsErrImageNotFound(err error) bool\n```\nIsErrImageNotFound returns true if the error is caused when an image is not found in the docker host.\n\n```go\nfunc IsErrNetworkNotFound(err error) bool\n```\nIsErrNetworkNotFound returns true if the error is caused when a network is not found in the docker host.\n\n```go\nfunc IsErrUnauthorized(err error) bool\n```\nIsErrUnauthorized returns true if the error is caused when an the remote registry authentication fails\n\n```go\nfunc IsErrVolumeNotFound(err error) bool\n```\nIsErrVolumeNotFound returns true if the error is caused when a volume is not found in the docker host.\n\n## Types\n\n```go\ntype APIClient interface {\n\tClientVersion() string\n\tContainerAttach(options types.ContainerAttachOptions) (types.HijackedResponse, error)\n\tContainerCommit(options types.ContainerCommitOptions) (types.ContainerCommitResponse, error)\n\tContainerCreate(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (types.ContainerCreateResponse, error)\n\tContainerDiff(containerID string) ([]types.ContainerChange, error)\n\tContainerExecAttach(execID string, config types.ExecConfig) (types.HijackedResponse, error)\n\tContainerExecCreate(config types.ExecConfig) (types.ContainerExecCreateResponse, error)\n\tContainerExecInspect(execID string) (types.ContainerExecInspect, error)\n\tContainerExecResize(options types.ResizeOptions) error\n\tContainerExecStart(execID string, config types.ExecStartCheck) error\n\tContainerExport(containerID string) (io.ReadCloser, error)\n\tContainerInspect(containerID string) (types.ContainerJSON, error)\n\tContainerInspectWithRaw(containerID string, getSize bool) (types.ContainerJSON, []byte, error)\n\tContainerKill(containerID, signal string) error\n\tContainerList(options types.ContainerListOptions) ([]types.Container, error)\n\tContainerLogs(options types.ContainerLogsOptions) (io.ReadCloser, error)\n\tContainerPause(containerID string) error\n\tContainerRemove(options types.ContainerRemoveOptions) error\n\tContainerRename(containerID, newContainerName string) error\n\tContainerResize(options types.ResizeOptions) error\n\tContainerRestart(containerID string, timeout int) error\n\tContainerStatPath(containerID, path string) (types.ContainerPathStat, error)\n\tContainerStats(containerID string, stream bool) (io.ReadCloser, error)\n\tContainerStart(containerID string) error\n\tContainerStop(containerID string, timeout int) error\n\tContainerTop(containerID string, arguments []string) (types.ContainerProcessList, error)\n\tContainerUnpause(containerID string) error\n\tContainerUpdate(containerID string, updateConfig container.UpdateConfig) error\n\tContainerWait(containerID string) (int, error)\n\tCopyFromContainer(containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)\n\tCopyToContainer(options types.CopyToContainerOptions) error\n\tEvents(options types.EventsOptions) (io.ReadCloser, error)\n\tImageBuild(options types.ImageBuildOptions) (types.ImageBuildResponse, error)\n\tImageCreate(options types.ImageCreateOptions) (io.ReadCloser, error)\n\tImageHistory(imageID string) ([]types.ImageHistory, error)\n\tImageImport(options types.ImageImportOptions) (io.ReadCloser, error)\n\tImageInspectWithRaw(imageID string, getSize bool) (types.ImageInspect, []byte, error)\n\tImageList(options types.ImageListOptions) ([]types.Image, error)\n\tImageLoad(input io.Reader) (types.ImageLoadResponse, error)\n\tImagePull(options types.ImagePullOptions, privilegeFunc RequestPrivilegeFunc) (io.ReadCloser, error)\n\tImagePush(options types.ImagePushOptions, privilegeFunc RequestPrivilegeFunc) (io.ReadCloser, error)\n\tImageRemove(options types.ImageRemoveOptions) ([]types.ImageDelete, error)\n\tImageSearch(options types.ImageSearchOptions, privilegeFunc RequestPrivilegeFunc) ([]registry.SearchResult, error)\n\tImageSave(imageIDs []string) (io.ReadCloser, error)\n\tImageTag(options types.ImageTagOptions) error\n\tInfo() (types.Info, error)\n\tNetworkConnect(networkID, containerID string, config *network.EndpointSettings) error\n\tNetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error)\n\tNetworkDisconnect(networkID, containerID string, force bool) error\n\tNetworkInspect(networkID string) (types.NetworkResource, error)\n\tNetworkList(options types.NetworkListOptions) ([]types.NetworkResource, error)\n\tNetworkRemove(networkID string) error\n\tRegistryLogin(auth types.AuthConfig) (types.AuthResponse, error)\n\tServerVersion() (types.Version, error)\n\tVolumeCreate(options types.VolumeCreateRequest) (types.Volume, error)\n\tVolumeInspect(volumeID string) (types.Volume, error)\n\tVolumeList(filter filters.Args) (types.VolumesListResponse, error)\n\tVolumeRemove(volumeID string) error\n}\n```\nAPIClient is an interface that clients that talk with a docker server must implement.\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient is the API client that performs all operations against a docker server.\n\n```go\nfunc NewClient(host string, version string, transport *http.Transport, httpHeaders map[string]string) (*Client, error)\n```\nNewClient initializes a new API client for the given host and API version. It won't send any version information if the version number is empty. It uses the transport to create a new http client. It also initializes the custom http headers to add to each request.\n\n```go\nfunc NewEnvClient() (*Client, error)\n```\nNewEnvClient initializes a new API client based on environment variables. Use DOCKER\\_HOST to set the url to the docker server. Use DOCKER\\_API\\_VERSION to set the version of the API to reach, leave empty for latest. Use DOCKER\\_CERT\\_PATH to load the tls certificates from. Use DOCKER\\_TLS\\_VERIFY to enable or disable TLS verification, off by default.\n\n```go\nfunc (cli *Client) ClientVersion() string\n```\nClientVersion returns the version string associated with this instance of the Client. Note that this value can be changed via the DOCKER\\_API\\_VERSION env var.\n\n```go\nfunc (cli *Client) ContainerAttach(options types.ContainerAttachOptions) (types.HijackedResponse, error)\n```\nContainerAttach attaches a connection to a container in the server. It returns a types.HijackedConnection with the hijacked connection and the a reader to get output. It's up to the called to close the hijacked connection by calling types.HijackedResponse.Close.\n\n```go\nfunc (cli *Client) ContainerCommit(options types.ContainerCommitOptions) (types.ContainerCommitResponse, error)\n```\nContainerCommit applies changes into a container and creates a new tagged image.\n\n```go\nfunc (cli *Client) ContainerCreate(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (types.ContainerCreateResponse, error)\n```\nContainerCreate creates a new container based in the given configuration. It can be associated with a name, but it's not mandatory.\n\n```go\nfunc (cli *Client) ContainerDiff(containerID string) ([]types.ContainerChange, error)\n```\nContainerDiff shows differences in a container filesystem since it was started.\n\n```go\nfunc (cli *Client) ContainerExecAttach(execID string, config types.ExecConfig) (types.HijackedResponse, error)\n```\nContainerExecAttach attaches a connection to an exec process in the server. It returns a types.HijackedConnection with the hijacked connection and the a reader to get output. It's up to the called to close the hijacked connection by calling types.HijackedResponse.Close.\n\n```go\nfunc (cli *Client) ContainerExecCreate(config types.ExecConfig) (types.ContainerExecCreateResponse, error)\n```\nContainerExecCreate creates a new exec configuration to run an exec process.\n\n```go\nfunc (cli *Client) ContainerExecInspect(execID string) (types.ContainerExecInspect, error)\n```\nContainerExecInspect returns information about a specific exec process on the docker host.\n\n```go\nfunc (cli *Client) ContainerExecResize(options types.ResizeOptions) error\n```\nContainerExecResize changes the size of the tty for an exec process running inside a container.\n\n```go\nfunc (cli *Client) ContainerExecStart(execID string, config types.ExecStartCheck) error\n```\nContainerExecStart starts an exec process already create in the docker host.\n\n```go\nfunc (cli *Client) ContainerExport(containerID string) (io.ReadCloser, error)\n```\nContainerExport retrieves the raw contents of a container and returns them as a io.ReadCloser. It's up to the caller to close the stream.\n\n```go\nfunc (cli *Client) ContainerInspect(containerID string) (types.ContainerJSON, error)\n```\nContainerInspect returns the container information.\n\n```go\nfunc (cli *Client) ContainerInspectWithRaw(containerID string, getSize bool) (types.ContainerJSON, []byte, error)\n```\nContainerInspectWithRaw returns the container information and it's raw representation.\n\n```go\nfunc (cli *Client) ContainerKill(containerID, signal string) error\n```\nContainerKill terminates the container process but does not remove the container from the docker host.\n\n```go\nfunc (cli *Client) ContainerList(options types.ContainerListOptions) ([]types.Container, error)\n```\nContainerList returns the list of containers in the docker host.\n\n```go\nfunc (cli *Client) ContainerLogs(options types.ContainerLogsOptions) (io.ReadCloser, error)\n```\nContainerLogs returns the logs generated by a container in an io.ReadCloser. It's up to the caller to close the stream.\n\n```go\nfunc (cli *Client) ContainerPause(containerID string) error\n```\nContainerPause pauses the main process of a given container without terminating it.\n\n```go\nfunc (cli *Client) ContainerRemove(options types.ContainerRemoveOptions) error\n```\nContainerRemove kills and removes a container from the docker host.\n\n```go\nfunc (cli *Client) ContainerRename(containerID, newContainerName string) error\n```\nContainerRename changes the name of a given container.\n\n```go\nfunc (cli *Client) ContainerResize(options types.ResizeOptions) error\n```\nContainerResize changes the size of the tty for a container.\n\n```go\nfunc (cli *Client) ContainerRestart(containerID string, timeout int) error\n```\nContainerRestart stops and starts a container again. It makes the daemon to wait for the container to be up again for a specific amount of time, given the timeout.\n\n```go\nfunc (cli *Client) ContainerStart(containerID string) error\n```\nContainerStart sends a request to the docker daemon to start a container.\n\n```go\nfunc (cli *Client) ContainerStatPath(containerID, path string) (types.ContainerPathStat, error)\n```\nContainerStatPath returns Stat information about a path inside the container filesystem.\n\n```go\nfunc (cli *Client) ContainerStats(containerID string, stream bool) (io.ReadCloser, error)\n```\nContainerStats returns near realtime stats for a given container. It's up to the caller to close the io.ReadCloser returned.\n\n```go\nfunc (cli *Client) ContainerStop(containerID string, timeout int) error\n```\nContainerStop stops a container without terminating the process. The process is blocked until the container stops or the timeout expires.\n\n```go\nfunc (cli *Client) ContainerTop(containerID string, arguments []string) (types.ContainerProcessList, error)\n```\nContainerTop shows process information from within a container.\n\n```go\nfunc (cli *Client) ContainerUnpause(containerID string) error\n```\nContainerUnpause resumes the process execution within a container\n\n```go\nfunc (cli *Client) ContainerUpdate(containerID string, updateConfig container.UpdateConfig) error\n```\nContainerUpdate updates resources of a container\n\n```go\nfunc (cli *Client) ContainerWait(containerID string) (int, error)\n```\nContainerWait pauses execution util a container is exits. It returns the API status code as response of its readiness.\n\n```go\nfunc (cli *Client) CopyFromContainer(containerID, srcPath string) (io.ReadCloser, types.ContainerPathStat, error)\n```\nCopyFromContainer get the content from the container and return it as a Reader to manipulate it in the host. It's up to the caller to close the reader.\n\n```go\nfunc (cli *Client) CopyToContainer(options types.CopyToContainerOptions) error\n```\nCopyToContainer copies content into the container filesystem.\n\n```go\nfunc (cli *Client) Events(options types.EventsOptions) (io.ReadCloser, error)\n```\nEvents returns a stream of events in the daemon in a ReadCloser. It's up to the caller to close the stream.\n\n```go\nfunc (cli *Client) ImageBuild(options types.ImageBuildOptions) (types.ImageBuildResponse, error)\n```\nImageBuild sends request to the daemon to build images. The Body in the response implement an io.ReadCloser and it's up to the caller to close it.\n\n```go\nfunc (cli *Client) ImageCreate(options types.ImageCreateOptions) (io.ReadCloser, error)\n```\nImageCreate creates a new image based in the parent options. It returns the JSON content in the response body.\n\n```go\nfunc (cli *Client) ImageHistory(imageID string) ([]types.ImageHistory, error)\n```\nImageHistory returns the changes in an image in history format.\n\n```go\nfunc (cli *Client) ImageImport(options types.ImageImportOptions) (io.ReadCloser, error)\n```\nImageImport creates a new image based in the source options. It returns the JSON content in the response body.\n\n```go\nfunc (cli *Client) ImageInspectWithRaw(imageID string, getSize bool) (types.ImageInspect, []byte, error)\n```\nImageInspectWithRaw returns the image information and it's raw representation.\n\n```go\nfunc (cli *Client) ImageList(options types.ImageListOptions) ([]types.Image, error)\n```\nImageList returns a list of images in the docker host.\n\n```go\nfunc (cli *Client) ImageLoad(input io.Reader) (types.ImageLoadResponse, error)\n```\nImageLoad loads an image in the docker host from the client host. It's up to the caller to close the io.ReadCloser returned by this function.\n\n```go\nfunc (cli *Client) ImagePull(options types.ImagePullOptions, privilegeFunc RequestPrivilegeFunc) (io.ReadCloser, error)\n```\nImagePull request the docker host to pull an image from a remote registry. It executes the privileged function if the operation is unauthorized and it tries one more time. It's up to the caller to handle the io.ReadCloser and close it properly.\n\n```go\nfunc (cli *Client) ImagePush(options types.ImagePushOptions, privilegeFunc RequestPrivilegeFunc) (io.ReadCloser, error)\n```\nImagePush request the docker host to push an image to a remote registry. It executes the privileged function if the operation is unauthorized and it tries one more time. It's up to the caller to handle the io.ReadCloser and close it properly.\n\n```go\nfunc (cli *Client) ImageRemove(options types.ImageRemoveOptions) ([]types.ImageDelete, error)\n```\nImageRemove removes an image from the docker host.\n\n```go\nfunc (cli *Client) ImageSave(imageIDs []string) (io.ReadCloser, error)\n```\nImageSave retrieves one or more images from the docker host as a io.ReadCloser. It's up to the caller to store the images and close the stream.\n\n```go\nfunc (cli *Client) ImageSearch(options types.ImageSearchOptions, privilegeFunc RequestPrivilegeFunc) ([]registry.SearchResult, error)\n```\nImageSearch makes the docker host to search by a term in a remote registry. The list of results is not sorted in any fashion.\n\n```go\nfunc (cli *Client) ImageTag(options types.ImageTagOptions) error\n```\nImageTag tags an image in the docker host\n\n```go\nfunc (cli *Client) Info() (types.Info, error)\n```\nInfo returns information about the docker server.\n\n```go\nfunc (cli *Client) NetworkConnect(networkID, containerID string, config *network.EndpointSettings) error\n```\nNetworkConnect connects a container to an existent network in the docker host.\n\n```go\nfunc (cli *Client) NetworkCreate(options types.NetworkCreate) (types.NetworkCreateResponse, error)\n```\nNetworkCreate creates a new network in the docker host.\n\n```go\nfunc (cli *Client) NetworkDisconnect(networkID, containerID string, force bool) error\n```\nNetworkDisconnect disconnects a container from an existent network in the docker host.\n\n```go\nfunc (cli *Client) NetworkInspect(networkID string) (types.NetworkResource, error)\n```\nNetworkInspect returns the information for a specific network configured in the docker host.\n\n```go\nfunc (cli *Client) NetworkList(options types.NetworkListOptions) ([]types.NetworkResource, error)\n```\nNetworkList returns the list of networks configured in the docker host.\n\n```go\nfunc (cli *Client) NetworkRemove(networkID string) error\n```\nNetworkRemove removes an existent network from the docker host.\n\n```go\nfunc (cli *Client) RegistryLogin(auth types.AuthConfig) (types.AuthResponse, error)\n```\nRegistryLogin authenticates the docker server with a given docker registry. It returns UnauthorizerError when the authentication fails.\n\n```go\nfunc (cli *Client) ServerVersion() (types.Version, error)\n```\nServerVersion returns information of the docker client and server host.\n\n```go\nfunc (cli *Client) VolumeCreate(options types.VolumeCreateRequest) (types.Volume, error)\n```\nVolumeCreate creates a volume in the docker host.\n\n```go\nfunc (cli *Client) VolumeInspect(volumeID string) (types.Volume, error)\n```\nVolumeInspect returns the information about a specific volume in the docker host.\n\n```go\nfunc (cli *Client) VolumeList(filter filters.Args) (types.VolumesListResponse, error)\n```\nVolumeList returns the volumes configured in the docker host.\n\n```go\nfunc (cli *Client) VolumeRemove(volumeID string) error\n```\nVolumeRemove removes a volume from the docker host.\n\n```go\ntype RequestPrivilegeFunc func() (string, error)\n```\nRequestPrivilegeFunc is a function interface that clients can supply to retry operations after getting an authorization error. This function returns the registry authentication header value in base 64 format, or an error if the privilege request fails.\n\n","path":"github.com/ripta/engine-api/client","name":"client","synopsis":"","isRedistributable":true}
