Documentation ¶
Index ¶
- Constants
- func ContainerRestart(containerID string) error
- func ContainerStats(containerID string) (*types.Stats, error)
- func CopyToContainer(containerID, destination string, reader io.Reader) error
- func CreateApplicationContainer(containerCfg types.ApplicationContainer) (string, error)
- func CreateDatabaseContainer(containerCfg types.DatabaseContainer) (string, error)
- func DeleteContainer(containerID string) error
- func DirectPull(image string) error
- func ExecDetachedProcess(containerID string, command []string) (string, error)
- func ExecProcess(containerID string, command []string) (string, error)
- func InspectContainerHealth(containerID string) (string, error)
- func InspectContainerState(containerID string) (*dockerTypes.ContainerState, error)
- func ListContainers() ([]string, error)
- func ListImages() ([]string, error)
- func NewClient() *client.Client
- func Pull(image string) error
- func ReadLogs(containerID, tail string) ([]string, error)
- func StartContainer(containerID string) error
- func StopContainer(containerID string) error
Constants ¶
const ( // Strings for ContainterHealth Container_Healthy = "healthy" Container_Unhealthy = "unhealthy" )
Variables ¶
This section is empty.
Functions ¶
func ContainerRestart ¶
ContainerRestart restarts the container corresponding to given containerID
func ContainerStats ¶
ContainerStats returns container statistics using the containerID
func CopyToContainer ¶
CopyToContainer copies the file from source path to the destination path inside the container Reader must be a tar archive
func CreateApplicationContainer ¶
func CreateApplicationContainer(containerCfg types.ApplicationContainer) (string, error)
CreateApplicationContainer creates a new container of the given container options, returns id of the container created
func CreateDatabaseContainer ¶
func CreateDatabaseContainer(containerCfg types.DatabaseContainer) (string, error)
CreateDatabaseContainer function creates a new container of the given container options, returns id of the container created
func DeleteContainer ¶
DeleteContainer deletes a docker container
func DirectPull ¶
DirectPull function directly pulls an image from DockerHUB using os/exec
func ExecDetachedProcess ¶
ExecDetachedProcess executes a command in detached form, returns the id of the process Command of the exec format: mkdir folder => ["mkdir", "folder"]
func ExecProcess ¶
ExecProcess executes a command in a blocing manner and returns the id of the process
func InspectContainerHealth ¶
ContainerHealth returns the health status of the container
func InspectContainerState ¶
func InspectContainerState(containerID string) (*dockerTypes.ContainerState, error)
InspectContainerState returns the state of the container using the containerID
func ListImages ¶
ListImages function returns a list of docker images present in the system
func StartContainer ¶
StartContainer starts the container corresponding to given containerID
func StopContainer ¶
StopContainer stops the container corresponding to given containerID
Types ¶
This section is empty.