Documentation
¶
Index ¶
- Constants
- Variables
- func CheckContainerExists(container_name string) (bool, error)
- func CheckContainerRunsWithImage(container_name, image string) (bool, error)
- func CheckVolumeExists(volume_name string) bool
- func CopyContainerResource(container_name string, source string, destination string) error
- func CreateContainer(container_name string, image string, labels map[string]string, ...) error
- func CreateContainerNetwork(network_name, driver string) error
- func CreateVolume(volume_name string, driver string, labels map[string]string) error
- func FetchContainerLogs(container_name string) (string, error)
- func FetchContainerStatus(container_name string) (string, error)
- func GetContainerEngine() string
- func GetContainerEnvVariable(container_name string, variable string) (string, error)
- func GetContainersNetwork() string
- func ImageAlreadyExists(image_name string) (bool, error)
- func PullImage(image_name string) error
- func RemoveContainer(container_name string, delete_volumes bool) error
- func RemoveVolume(volume_name string, force bool) error
- func ResumeContainer(container_name string) error
- func RunContainerCommand(container_name string, command ...string) error
- func RunContainerCommandWithOutput(containerName string, command ...string) ([]byte, error)
- func SetContainerEngine(op string) error
- func SetContainersNetwork(network string) error
- func StopContainer(container_name string) error
- func WaitForContainerReadiness(container_name string, retry_interval int, max_retries int) error
Constants ¶
const (
ALPHANUMERICS_REGEX = `^[a-zA-Z0-9_-]+$`
)
Variables ¶
var ( VALID_RESTART_POLICY = regexp.MustCompile(`^(always|no|unless-stopped|on-failure:\d+)$`) VALID_VOLUME_NAME = VALID_CONTAINER_NAME VALID_CONTAINER_NAME = regexp.MustCompile(ALPHANUMERICS_REGEX) VALID_NETWORK_NAME = VALID_CONTAINER_NAME )
Functions ¶
func CheckContainerExists ¶
CheckContainerExists checks if a container exists by its name
func CheckContainerRunsWithImage ¶
CheckContainerRunsWithImage checks if a container is running with a specific image
func CheckVolumeExists ¶
CheckVolumeExists checks if a volume exists by its name
func CopyContainerResource ¶
func CreateContainer ¶
func CreateContainerNetwork ¶
CreateContainerNetwork creates a network if it doesn't exist
func CreateVolume ¶
CreateVolume creates a volume with a given name, driver, and labels
func FetchContainerLogs ¶
FetchContainerLogs returns the logs of a container by its name returns the entire log as a string
func FetchContainerStatus ¶
FetchContainerStatus returns the status of a container by its name
func GetContainerEngine ¶
func GetContainerEngine() string
func GetContainerEnvVariable ¶
func GetContainersNetwork ¶
func GetContainersNetwork() string
func ImageAlreadyExists ¶
func RemoveContainer ¶
RemoveContainer deletes a container by its name, and optionally deletes its volumes
func RemoveVolume ¶
RemoveVolume deletes a volume by its name WARNING: force is set to true to remove the volume even if it is in use
func ResumeContainer ¶
ResumeContainer resumes a container by its name
func RunContainerCommand ¶
func SetContainerEngine ¶
========== Container engine ==========
func SetContainersNetwork ¶
========== Container network ==========
func StopContainer ¶
Types ¶
This section is empty.