Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultPort = 22 DefaultUser = "root" DefaultKeyFile = "~/.ssh/id_rsa" )
default remote info
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RemoteOption ¶
type RemoteOption struct { Host string Port string User string KeyFile *string Password *string WorkDir string Command *Command File *TransferFile Session *ssh.Session SftpClient *sftp.Client NetDevice string }
func NewRemoteOption ¶
func NewRemoteOption(host, port, user, password, key, netdevice string) (*RemoteOption, error)
NewRemoteOption return a new RemoteOption
func (*RemoteOption) Close ¶
func (r *RemoteOption) Close()
func (*RemoteOption) CopyFileFromRemote ¶
func (r *RemoteOption) CopyFileFromRemote() error
func (*RemoteOption) CopyFileToRmote ¶
func (r *RemoteOption) CopyFileToRmote() error
func (*RemoteOption) RunCommand ¶
func (r *RemoteOption) RunCommand() (string, error)
type TransferFile ¶
Click to show internal directories.
Click to hide internal directories.