Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (client *Client) CopyFileFromRemote(remoteFile string, localFile string) error
- func (client *Client) CopyFileToRemote(localFile string, remoteFile string) error
- func (client *Client) Disconnect() error
- func (client *Client) MoveFileAtRemote(from string, to string) error
- func (client *Client) RunCommand(cmd string, stdIn, stdOut, stdErr *os.File) error
- func (client *Client) SetRemoteEnv(name string, value string)
- func (client *Client) SetRemoteEnvMap(envVariables map[string]string)
- func (client *Client) StartInteractiveSession() error
Constants ¶
const ResizeEvent syscall.Signal = syscall.SIGWINCH
ResizeEvent is syscall resize event.
Variables ¶
var Fd int = int(os.Stdin.Fd())
Fd is file descriptor to get terminal size.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used to run commands and set up environment variables in the remote.
func ConnectAuto ¶
ConnectAuto tries to connect with all available methods. The sequence is SSH Agent, public key, password
func ConnectWithPassword ¶
ConnectWithPassword connect to the remote and prompts user for password.
func ConnectWithSshAgent ¶
ConnectWithSshAgent tries to connect to remote using sshagent. Only available on unix systems.
func (*Client) CopyFileFromRemote ¶
CopyFileFromRemote copies file from the remote to local over SSH.
func (*Client) CopyFileToRemote ¶
CopyFileToRemote copies local file to remote over SSH.
func (*Client) Disconnect ¶
Disconnect disconnects the client.
func (*Client) MoveFileAtRemote ¶
MoveFileAtRemote moves file in remote from location to another.
func (*Client) RunCommand ¶
RunCommand runs single command in the remote.
func (*Client) SetRemoteEnv ¶
SetRemoteEnv sets remote environment variable that will be set when interactive session is started with StartInteractiveSession.
func (*Client) SetRemoteEnvMap ¶
SetRemoteEnvMap sets remote environment variables from map that will be set when interactive session is started with StartInteractiveSession.
func (*Client) StartInteractiveSession ¶
StartInteractiveSession starts interactive shell session with the remote.