sshutil

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: Apache-2.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 SSH

type SSH struct {
	User     string
	Password string
	PkFile   string
	Timeout  *time.Duration
}

func (*SSH) Cmd

func (ss *SSH) Cmd(host string, cmd string) []byte

Cmd is in host exec cmd

func (*SSH) CmdAsync added in v1.5.1

func (ss *SSH) CmdAsync(host string, cmd string) error

func (*SSH) CmdToString

func (ss *SSH) CmdToString(host, cmd, spilt string) string

CmdToString is in host exec cmd and replace to spilt str

func (*SSH) Connect

func (ss *SSH) Connect(host string) (*ssh.Session, error)

* 这里主要是做连接ssh操作的

func (*SSH) Copy

func (ss *SSH) Copy(host, localFilePath, remoteFilePath string)

Copy is

func (*SSH) CopyForMD5 added in v1.4.1

func (ss *SSH) CopyForMD5(host, localFilePath, remoteFilePath, md5 string) bool

Copy is

func (*SSH) Md5Sum added in v1.4.1

func (ss *SSH) Md5Sum(host, remoteFilePath string) string

Jump to

Keyboard shortcuts

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