utils

package
v0.0.0-...-ce8a164 Latest Latest
Warning

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

Go to latest
Published: May 15, 2016 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSharedFolders

func CheckSharedFolders() bool

CheckSharedFolders seturn true if shared folders exist and the user agrees to removing them

func Cleanup

func Cleanup()

Cleanup removes dangling images and exited containers.

func CleanupDockerContainersList

func CleanupDockerContainersList() ([]dockerclient.APIContainers, error)

CleanupDockerContainersList returns a list of containers to be removed

func CleanupDockerImageList

func CleanupDockerImageList() ([]dockerclient.APIImages, error)

CleanupDockerImageList returns a list of images to be removed

func CreateTemplateTempFile

func CreateTemplateTempFile(data func() ([]byte, error), perms os.FileMode, templateData interface{}) *os.File

CreateTemplateTempFile resurrects a go-bindata asset and execute the template (if any) it contains. return a reference to the temporary file

func DefaultComposeFile

func DefaultComposeFile() string

DefaultComposeFile gets the default docker-compose.yml file

func DefaultParityConfigurationFile

func DefaultParityConfigurationFile() string

DefaultParityConfigurationFile gets the default parity configuration file

func DockerClient

func DockerClient() *dockerclient.Client

DockerClient creates a docker client from environment

func DockerHost

func DockerHost() string

DockerHost gets the ip:port of the current active Docker Machine

func DockerVMHost

func DockerVMHost() (string, error)

DockerVMHost gets the IP address of the underlying VM for the current active Docker Machine

func FindDockerComposeFiles

func FindDockerComposeFiles() []string

FindDockerComposeFiles returns the list of Docker Compose files in the current project. Currently just defaults to a single ['docker-compose.yml']

func FindNetwork

func FindNetwork(ip string) (net.IP, net.Addr, error)

FindNetwork will return the IP and Network interface given an IP address.

func FindSharedFolders

func FindSharedFolders() []string

FindSharedFolders gets the list of shared folders on the remote Docker Host

func MirrorHost

func MirrorHost() string

MirrorHost gets the ip:port of the current active Docker Machine

func ProjectNameSafe

func ProjectNameSafe(name string) string

ProjectNameSafe creates a Docker Compose compatible (safe) name given a string

func PublicKeyFile

func PublicKeyFile(file string) ssh.AuthMethod

PublicKeyFile reads a public key and returns an SSH auth method

func ReadComposeVolumes

func ReadComposeVolumes() []string

ReadComposeVolumes reads a docker-compose.yml and return a slice of directories to sync into the Docker Host

"." and "./." is converted to the current directory parity is running from. Any volume starting with "/" will be treated as an absolute path. All other volumes (e.g. starting with "./" or without a prefix "/") will be treated as relative paths.

func RunCommand

func RunCommand(host string, command string, reader io.Reader, stdOut io.Writer, stdErr io.Writer) error

RunCommand runs command on a given SSH connection

func RunCommandAndReturn

func RunCommandAndReturn(host string, command string) (string, error)

RunCommandAndReturn runs a command on a given SSH Connection and return the output of Stdout

func RunCommandWithDefaults

func RunCommandWithDefaults(host string, command string) error

RunCommandWithDefaults runs a command on a host using the default configuration for I/O redirection

func SSHConfig

func SSHConfig() *ssh.ClientConfig

SSHConfig gets an SSH configuration to the Docker Host

func SSHSession

func SSHSession(host string) (session *ssh.Session, err error)

SSHSession creates an SSH Session for a remote Docker host

func UnmountSharedFolders

func UnmountSharedFolders()

UnmountSharedFolders unmounts all shared folders on the remote Docker host

func WaitForNetwork

func WaitForNetwork(name string, host string)

WaitForNetwork waits for a network connection to become available within a timeout

func WaitForNetworkWithTimeout

func WaitForNetworkWithTimeout(name string, host string, timeout time.Duration)

WaitForNetworkWithTimeout waits for a network connection to become available within a timeout

Types

This section is empty.

Jump to

Keyboard shortcuts

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