sshutil

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Md5FromLocal

func Md5FromLocal(localPath string) string

Types

type SSH

type SSH struct {
	User    string
	Pass    string
	PkFile  string
	PkPass  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) 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{})

CopyConfigFile is

func (*SSH) CopyForMD5

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

CopyForMD5 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

IsFileExist is

func (*SSH) LoggerFileSize

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

LoggerFileSize 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