helpers

package
v0.0.0-...-c7d11c1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainerExists

func ContainerExists(name string) bool

Checks if a container exists

func ContainerExitCode

func ContainerExitCode(containerName string) string

func ContainerIsRunning

func ContainerIsRunning(name string) bool

Check if a container is running

func GetContainerImageId

func GetContainerImageId(name string) string

Get the image id for a given container

func GetContainerServiceNameLabel

func GetContainerServiceNameLabel(containerName string) string

Get the value of the label used to record the run service name (for scaling)

func GetContainerUniqueLabel

func GetContainerUniqueLabel(containerName string) string

Get the value of the label used to record the run arguments used when creating the container

func GetImageId

func GetImageId(imageName string) string

Get the id for a given image name

func GetNumericSuffix

func GetNumericSuffix(name string, sep string) (int, error)

func GetProjectState

func GetProjectState(projName string, projSep string) (svcs map[string]*ServiceState, err error)

func HashInterfaceSlice

func HashInterfaceSlice(args []interface{}) string

func PullImage

func PullImage(imageName string) error

pull the image for a given image name

func RandStringBytesMaskImprSrc

func RandStringBytesMaskImprSrc(n int) string

stole this from stack overflow.

func RenameContainer

func RenameContainer(currentName string, newName string) error

func RunCmd

func RunCmd(args ...interface{}) (out []byte, err error)

Helper to run a docker command

func ToInterfaceSlice

func ToInterfaceSlice(data []string) (out []interface{})

func ToStringSlice

func ToStringSlice(data []interface{}) (out []string)

func WasContainerStartedAfter

func WasContainerStartedAfter(name string, afterTime time.Time) (bool, error)

func WasContainerStartedAfterOrRetry

func WasContainerStartedAfterOrRetry(name string, afterTime time.Time, maxAttempts int, interval time.Duration) bool

Types

type ServiceState

type ServiceState struct {
	ID          string
	Name        string
	ServiceName string
	InstanceNum int
	Color       string
	Running     bool
	ArgsHash    string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL