sshutil

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2021 License: Apache-2.0 Imports: 17 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
	PkPassword string
	Timeout    *time.Duration
	Debug      bool
}

func (*SSH) Cmd

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

Cmd is in host exec cmd

func (*SSH) CmdAndError

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

func (*SSH) CmdAsync

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)

func (*SSH) Copy

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

Copy is

func (*SSH) CopyConfigFile

func (ss *SSH) CopyConfigFile(host, remoteFilePath string, localFilePathOrBytes interface{})

Copy is

func (*SSH) CopyForMD5

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

Copy is

func (*SSH) CopyLocalToRemote

func (ss *SSH) CopyLocalToRemote(host, localPath, remotePath string)

CopyLocalToRemote is copy file or dir to remotePath, add md5 validate

func (*SSH) CopyRemoteFileToLocal

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

CopyRemoteFileToLocal is scp remote file to local

func (*SSH) IsFileExist

func (ss *SSH) IsFileExist(host, remoteFilePath string) bool

RemoteFileExist is

func (*SSH) LoggerFileSize

func (ss *SSH) LoggerFileSize(host, filename string, size int)

WatchFileSize is

func (*SSH) Md5Sum

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

func (*SSH) ValidateMd5sumLocalWithRemote

func (ss *SSH) ValidateMd5sumLocalWithRemote(host, localFile, remoteFile string) bool

Jump to

Keyboard shortcuts

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