ssh

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsLinuxBuildInPath added in v0.5.6

func IsLinuxBuildInPath(filepath string) bool

判断是否是 linux 的危险路径,通常这个路径是不能删除的

Types

type Client

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

func NewSSH

func NewSSH() *Client

func (*Client) Connect

func (c *Client) Connect(host, port, username string, password *string, privateKey *[]byte) error

func (*Client) Copy

func (c *Client) Copy(sourceFilepath string, destinationFilepath string) error

func (*Client) Delete

func (c *Client) Delete(files ...string) error

func (*Client) Disconnect

func (c *Client) Disconnect() error

func (*Client) Download

func (c *Client) Download(remoteFilePath string, localDir string) error

func (*Client) Env

func (c *Client) Env(key string, options Options) (string, error)

func (*Client) Move

func (c *Client) Move(oldFilepath string, newFilepath string) error

func (*Client) Pwd

func (c *Client) Pwd() (string, error)

func (*Client) Run

func (c *Client) Run(command string, options Options) (stdout bytes.Buffer, stderr bytes.Buffer, err error)

func (*Client) Upload

func (c *Client) Upload(localFilePath string, remoteDir string) error

type Options added in v0.5.6

type Options struct {
	CWD string            `json:"cwd"`
	Env map[string]string `json:"env"`
}

type Writer added in v0.8.0

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

func (Writer) Write added in v0.8.0

func (w Writer) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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