ssh

package
v0.0.0-...-33f8601 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

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 ssh客户端,支持scp的.

func NewClient

func NewClient(host string, port int, user, passwd, keyFile string) (*Client, error)

NewClient 创建ssh客户端.

func (*Client) Exec

func (c *Client) Exec(cmd string) (string, error)

Exec 执行命令并等待返回结果.

func (*Client) ExecPipe

func (c *Client) ExecPipe(cmdStr string, setPipe func(stdOut, stdErr io.Reader)) error

ExecPipe 执行命令并设置输出流.

func (*Client) Upload

func (c *Client) Upload(src, dest string) error

Upload 上传文件.

Jump to

Keyboard shortcuts

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