Documentation ¶
Index ¶
- func Close(client scp.Client)
- func Connect(sshInfo SSHInfo) (scp.Client, error)
- func ConnectKeyPath(sshKeyPathInfo SSHKeyPathInfo) (scp.Client, error)
- func Copy(client scp.Client, sourcePath string, remotePath string) error
- func RunCommand(client scp.Client, cmd string) (string, error)
- func SSHCopy(sshInfo SSHInfo, sourcePath string, remotePath string) error
- func SSHCopyByKeyPath(sshInfo SSHKeyPathInfo, sourcePath string, remotePath string) error
- func SSHRun(sshInfo SSHInfo, cmd string) (string, error)
- func SSHRunByKeyPath(sshInfo SSHKeyPathInfo, cmd string) (string, error)
- type SSHInfo
- type SSHKeyPathInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectKeyPath ¶
func ConnectKeyPath(sshKeyPathInfo SSHKeyPathInfo) (scp.Client, error)
func RunCommand ¶
func SSHCopyByKeyPath ¶
func SSHCopyByKeyPath(sshInfo SSHKeyPathInfo, sourcePath string, remotePath string) error
func SSHRunByKeyPath ¶
func SSHRunByKeyPath(sshInfo SSHKeyPathInfo, cmd string) (string, error)
Types ¶
type SSHInfo ¶
type SSHInfo struct { UserName string // ex) "root" PrivateKey []byte // ex) []byte(`-----BEGIN RSA PRIVATE KEY----- // MIIEoQIBAAKCAQEArVNOLwMIp5VmZ4VPZotcoCHdEzimKalAsz+ccLfvAA1Y2ELH // ...`) ServerPort string // ex) "node12:22" }
====================================================================
type SSHKeyPathInfo ¶
type SSHKeyPathInfo struct { UserName string // ex) "root" KeyPath string // ex) "/root/.ssh/id_rsa // You should use the full path. ServerPort string // ex) "node12:22" }
====================================================================
Click to show internal directories.
Click to hide internal directories.