Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client struct for ssh
func Dial ¶
func Dial(network, addr string, config *ssh.ClientConfig) (*Client, error)
Dial starts a client connection to the given SSH server. This is wrap the ssh.Dial
func DialWithKey ¶
DialWithKey starts a client connection to the given SSH server with key auth method.
func DialWithPasswd ¶
DialWithPasswd starts a client connection to the given SSH server with password auth method.
func (*Client) Shell ¶
func (c *Client) Shell() *RemoteShell
Shell create a noninteractive shell on client.
type RemoteScript ¶
type RemoteScript struct {
// contains filtered or unexported fields
}
RemoteScript is a wrap for command on remote machine
func (*RemoteScript) Output ¶
func (rs *RemoteScript) Output() ([]byte, error)
Output wil return output as []byte
func (*RemoteScript) SetStdio ¶
func (rs *RemoteScript) SetStdio(stdout, stderr io.Writer) *RemoteScript
SetStdio will set stdio and stderr
type RemoteShell ¶
type RemoteShell struct {
// contains filtered or unexported fields
}
RemoteShell struct to execute many commands in 1 pipe
func (*RemoteShell) SetStdio ¶
func (rs *RemoteShell) SetStdio(stdin io.Reader, stdout, stderr io.Writer) *RemoteShell
SetStdio set stdio, stderr and stdin to remote shell
func (*RemoteShell) Start ¶
func (rs *RemoteShell) Start(commands []string) error
Start start a remote shell on client and run slice of commands
type TerminalConfig ¶
type TerminalConfig struct { Term string Height int Weight int Modes ssh.TerminalModes }
TerminalConfig struct for shell