util

package
v0.0.0-...-5d23293 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2015 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

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

func GetKeyFile(keyPath string) (key ssh.Signer, err error)

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.

func LogFatal

func LogFatal(msg string, err error)

LogFatal

func PPrompt

func PPrompt(p string) string

PPrompt prompts for a password but keeps the typed response hidden

func Prompt

func Prompt(p string, v ...interface{}) string

Prompt will prompt for input from the shell and return a trimmed response

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'

Jump to

Keyboard shortcuts

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