Documentation
¶
Index ¶
- Constants
- func MustCreateDefaultKeyBasedAuth() []ssh.AuthMethod
- func MustCreateKeyBasedAuth(keyFile string) []ssh.AuthMethod
- func MustCreateNewPwdBasedAuth(pwd string) []ssh.AuthMethod
- func NewKeyBasedAuth(keyFile string) ([]ssh.AuthMethod, error)
- func NewPwdBasedAuth(pwd string) ([]ssh.AuthMethod, error)
- type ConsoleLogger
- type LocalNode
- type Logger
- type Node
- type SSHConfig
- type SSHNode
- type ShellOpt
- type SpawnOpt
- type Tunnel
- func (w *Tunnel) CD(dir string)
- func (w *Tunnel) Dir() string
- func (w *Tunnel) Logger() Logger
- func (w *Tunnel) Node() Node
- func (w *Tunnel) Shell(params *ShellOpt) string
- func (w *Tunnel) ShellRaw(params *ShellOpt) (string, error)
- func (w *Tunnel) Spawn(params *SpawnOpt)
- func (w *Tunnel) SpawnRaw(params *SpawnOpt) error
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func MustCreateDefaultKeyBasedAuth ¶
func MustCreateDefaultKeyBasedAuth() []ssh.AuthMethod
Creates a new ssh.AuthMethod with the default key file("~/.ssh/id_rsa").
func MustCreateKeyBasedAuth ¶
func MustCreateKeyBasedAuth(keyFile string) []ssh.AuthMethod
Creates a new ssh.AuthMethod with the given key file, panics if there is an error.
func MustCreateNewPwdBasedAuth ¶
func MustCreateNewPwdBasedAuth(pwd string) []ssh.AuthMethod
Creates a new ssh.AuthMethod with the given password, panics if there is an error.
func NewKeyBasedAuth ¶
func NewKeyBasedAuth(keyFile string) ([]ssh.AuthMethod, error)
Creates a new ssh.AuthMethod with the given key file.
func NewPwdBasedAuth ¶
func NewPwdBasedAuth(pwd string) ([]ssh.AuthMethod, error)
Creates a new ssh.AuthMethod with the given password.
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
}
func NewConsoleLogger ¶
func NewConsoleLogger() *ConsoleLogger
func (*ConsoleLogger) Log ¶
func (c *ConsoleLogger) Log(level int, message string)
type LocalNode ¶
type LocalNode struct {
}
LocalNode is used for running commands locally.
func NewLocalNode ¶
func NewLocalNode() *LocalNode
type SSHConfig ¶
type SSHConfig struct {
Host string
User string
Port int
Auth []ssh.AuthMethod
}
SSHConfig is the configuration for SSHNode.
type SSHNode ¶
type SSHNode struct {
Logger Logger
// contains filtered or unexported fields
}
SSHNode is a node that runs commands on a remote SSH server.
func MustCreateSSHNode ¶
Creates a new SSH node with the given configuration, panics if there is an error.
func NewSSHNode ¶
Creates a new SSH node with the given configuration.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.