Documentation ¶
Index ¶
- type Client
- func (cl *Client) CalculateStats(jsonStats *types.StatsJSON) *models.Stats
- func (cl *Client) ContainerCreate(name string, config *container.Config, hostConfig *container.HostConfig, ...) (*container.ContainerCreateCreatedBody, error)
- func (cl *Client) ContainerGet(containerID string) (*types.ContainerJSON, error)
- func (cl *Client) ContainerLogs(containerID string, tailNumberLines int, sinceTimestamp time.Time) (*models.DockerLogs, error)
- func (cl *Client) ContainerLogsStream(containerID string, output chan []byte, done chan bool) error
- func (cl *Client) ContainerRemove(containerID string) error
- func (cl *Client) ContainerRename(containerID string, newContainerName string) error
- func (cl *Client) ContainerReplace(containerID string, image string, tag string) error
- func (cl *Client) ContainerRestart(containerID string, waitForRestartLimit time.Duration) error
- func (cl *Client) ContainerStart(containerID string) error
- func (cl *Client) ContainerStats(containerID string) (*types.StatsJSON, error)
- func (cl *Client) ContainerStop(containerID string, forceKillAfter *time.Duration) error
- func (cl *Client) ContainersList() ([]types.Container, error)
- func (cl *Client) ContainersListWithOptions(opts types.ContainerListOptions) ([]types.Container, error)
- func (cl *Client) ContainersPrune(pruneFilter filters.Args) (*types.ContainersPruneReport, error)
- func (cl *Client) GetDockerClient() *client.Client
- func (cl *Client) ImagePullDockerHub(image, tag string, username, password string) (string, error)
- func (cl *Client) ImageRemove(imageID string) ([]types.ImageDeleteResponseItem, error)
- func (cl *Client) ImagesList() ([]types.ImageSummary, error)
- func (cl *Client) SystemWideInfo() (types.Info, types.DiskUsage, error)
- func (cl *Client) VolumesPrune(pruneFilter filters.Args) (*types.VolumesPruneReport, error)
- type Docker
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client - digitalocean abstraction
func (*Client) CalculateStats ¶
CalculateStats - converting container stats into more easy readable stats
func (*Client) ContainerCreate ¶
func (cl *Client) ContainerCreate(name string, config *container.Config, hostConfig *container.HostConfig, networkConfig *network.NetworkingConfig) (*container.ContainerCreateCreatedBody, error)
ContainerCreate - Creates a new container
func (*Client) ContainerGet ¶
func (cl *Client) ContainerGet(containerID string) (*types.ContainerJSON, error)
ContainerGet insepcts a container
func (*Client) ContainerLogs ¶
func (cl *Client) ContainerLogs(containerID string, tailNumberLines int, sinceTimestamp time.Time) (*models.DockerLogs, error)
ContainerLogs - retrurn last defined number of lines since timestamp (if larger than zero)
func (*Client) ContainerLogsStream ¶
ContainerLogsStream streams logs from server until done channel received true
func (*Client) ContainerRemove ¶ added in v1.0.5
ContainerRemove - removing the container. timeout in 10 seconds, force removing all
func (*Client) ContainerRename ¶ added in v1.0.5
replaceRevert reverts the phases done by ContainerReplace function in case of errors
func (*Client) ContainerReplace ¶ added in v1.0.5
func (*Client) ContainerRestart ¶
ContainerRestart - restarting a running container
func (*Client) ContainerStart ¶
ContainerStart - start a created container
func (*Client) ContainerStats ¶
ContainerStats - returns a snapshot of container stats in a moment it's called
func (*Client) ContainerStop ¶
ContainerStop - stops the container
func (*Client) ContainersList ¶
ContainersList for all docker containers
func (*Client) ContainersListWithOptions ¶
func (cl *Client) ContainersListWithOptions(opts types.ContainerListOptions) ([]types.Container, error)
ContainersListWithOptions list containers with various filters
func (*Client) ContainersPrune ¶
ContainersPrune - cleaning up non-running containers
func (*Client) GetDockerClient ¶
GetDockerClient - return configured docker client
func (*Client) ImagePullDockerHub ¶
ImagePullDockerHub - pull private image from docker hub (it waits for pull to finish)
func (*Client) ImageRemove ¶
func (cl *Client) ImageRemove(imageID string) ([]types.ImageDeleteResponseItem, error)
ImageRemove - removes an image by force and prunes its children
func (*Client) ImagesList ¶
func (cl *Client) ImagesList() ([]types.ImageSummary, error)
ImagesList - returns list of pulled images
func (*Client) SystemWideInfo ¶ added in v1.0.7
func (*Client) VolumesPrune ¶
VolumesPrune - cleaning up non-attached volumes
type Docker ¶
type Docker interface { ContainersList() ([]types.Container, error) ContainersListWithOptions(opts types.ContainerListOptions) ([]types.Container, error) ContainerLogs(containerID string, tailNumberLines int, sinceTimestamp time.Time) (*models.DockerLogs, error) // ContainerLogsStream streams logs to output channel until done is received. User is responsible to close the passed in channel ContainerLogsStream(containerID string, output chan []byte, done chan bool) error // Container CRUD operations ContainerCreate(name string, config *container.Config, hostConfig *container.HostConfig, networkConfig *network.NetworkingConfig) (*container.ContainerCreateCreatedBody, error) ContainerStart(containerID string) error ContainerRestart(containerID string, waitForRestartLimit time.Duration) error ContainersPrune(pruneFilter filters.Args) (*types.ContainersPruneReport, error) ContainerStop(containerID string, killAfterTimeout *time.Duration) error ContainerGet(containerID string) (*types.ContainerJSON, error) ContainerStats(containerID string) (*types.StatsJSON, error) ImagesList() ([]types.ImageSummary, error) ImagePullDockerHub(image, tag string, username, password string) (string, error) ImageRemove(imageID string) ([]types.ImageDeleteResponseItem, error) VolumesPrune(pruneFilter filters.Args) (*types.VolumesPruneReport, error) GetDockerClient() *client.Client CalculateStats(jsonStats *types.StatsJSON) *models.Stats ContainerRemove(containerID string) error ContainerRename(containerID string, newContainerName string) error ContainerReplace(containerID string, image string, tag string) error // host system information SystemWideInfo() (types.Info, types.DiskUsage, error) }
Docker API interfaces
func NewLocalClient ¶
NewLocalClient creates a client without TLS connection (recommended only if running on localhost)