Documentation ¶
Index ¶
- func CPrint(msg string, v ...interface{})
- func FindGitConfigFile() (ini.File, error)
- func FindPagodaApp() string
- func GetKeyFile(keyPath string) (key ssh.Signer, err error)
- func LogFatal(msg string, err error)
- func PPrompt(p string) string
- func Prompt(p string, v ...interface{}) string
- type SSHOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CPrint ¶
func CPrint(msg string, v ...interface{})
CPrint wraps a print message in 'colorstring' and passes it to fmt.Println
func FindGitConfigFile ¶
func FindGitConfigFile() (ini.File, error)
FindGitConfig attempts to find a .git/config file and return the file and containing path. If no file is found (path '/'), returns an error
func FindPagodaApp ¶
func FindPagodaApp() string
FindPagodaApp attempts to find a .git/config file and iterate over the 'remotes' looking for any 'pagoda' remotes. If none are found, prompts for an app-name. If one is found, it returns that app-name. If more than one is found, display a list of found apps and prompt for which to use.
func GetKeyFile ¶
GetKeyFile attempts to read a ~/.ssh/id_rsa file. If none is found it prompts for a path to the file, or provides information on how to generate an ssh key. If a key is found it attempts to decode the key, prompting for a password if the key is encrypted, and returns the key for use with SSH.
Types ¶
type SSHOptions ¶
type SSHOptions struct { Command string // The command to run when using the 'run' action Config *ssh.ClientConfig // Determines the user and auth method when connecting LocalHost string // The forward IP when tunneling (127.0.0.1) LocalPort int // The forward port when tunneling RemoteHost string // RemotePort string // RemoteUser string // ServerIP string // ServerPort int // ServiceApp string // ServiceUser string // ServicePass string // }
SSHOptions represents all the options needed when attempting an SSH action. These actions include 'run', 'ssh', and 'tunnel'