utilSsh

package
v0.0.0-...-5f3621a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: MulanPSL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const PROXY_TYPE_SOCKS5 = "socks5"

Variables

This section is empty.

Functions

func SftpSendFile

func SftpSendFile(sftpClient *sftp.Client, localFile string, remoteFile string) error

func SshConnect

func SshConnect(addr string, user string, password string, needSftp bool, execFn SshExecFunc) (err error)

func SshExec

func SshExec(sshClient *ssh.Client, command string, wait ...bool) (string, error)

Types

type SshExecFunc

type SshExecFunc func(sshClient *ssh.Client, sftpClient *sftp.Client) error

type UtilSshClient

type UtilSshClient struct {
	// contains filtered or unexported fields
}

func NewSshClient

func NewSshClient() (client *UtilSshClient)

func (*UtilSshClient) Close

func (c *UtilSshClient) Close()

func (*UtilSshClient) Connect

func (c *UtilSshClient) Connect(addr string, user string, password string, timeout ...time.Duration) (err error)

func (*UtilSshClient) Exec

func (c *UtilSshClient) Exec(command string, wait ...bool) (output string, err error)

func (*UtilSshClient) SendFile

func (c *UtilSshClient) SendFile(localFile string, remoteFile string) (err error)

func (*UtilSshClient) UseProxySocks5

func (c *UtilSshClient) UseProxySocks5(proxyAddr string, proxyUser string, proxyPassword string) (err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL