Documentation ¶
Index ¶
- Constants
- func ConvertInterfaceToMapInterfaceInterface(in interface{}) (map[interface{}]interface{}, error)
- func ConvertInterfaceToSliceInterface(in interface{}) ([]interface{}, error)
- func ElementInSlice(e interface{}, s interface{}) (bool, error)
- func KeyInMap(k interface{}, m interface{}) (bool, error)
- func PathExists(in ...interface{}) (bool, error)
- func PathExistsLocal(path string) (bool, error)
- func PathExistsRemote(path string, client *sftp.Client) (bool, error)
- func TrimSpaceOfStructString(in interface{}) error
- func ValueInMap(v interface{}, m interface{}) (bool, error)
- type CloseConn
- type MyConn
- type MySSHConn
- type MySftpConn
- func (conn *MySftpConn) CloseConn() (err error)
- func (conn *MySftpConn) CopyFile(fileSource io.Reader, fileDest io.Writer, bufferSize int) (err error)
- func (conn *MySftpConn) CopyFileListFromRemote(fileListSource []string, FileDirDest string) (err error)
- func (conn *MySftpConn) CopyFileListFromRemoteWithNewName(fileListSource []string, FileListDest []string) (err error)
- func (conn *MySftpConn) CopySingleFileFromRemote(fileNameSource string, fileNameDest string) (err error)
- func (conn *MySftpConn) CopySingleFileToRemote(fileNameSource string, fileNameDest string) (err error)
Constants ¶
View Source
const ( DefaultStringZeroValue = "" DefaultIntZeroValue = 0 DefaultSSHTimeout = 10 * time.Second DefaultSSHPortNum = 22 DefaultSSHUserName = "root" DefaultSSHUserPass = "shit" DefaultByteBufferSize = 1024 * 1024 // 1MB )
Variables ¶
This section is empty.
Functions ¶
func ConvertInterfaceToMapInterfaceInterface ¶
func ConvertInterfaceToMapInterfaceInterface(in interface{}) (map[interface{}]interface{}, error)
func ConvertInterfaceToSliceInterface ¶
func ConvertInterfaceToSliceInterface(in interface{}) ([]interface{}, error)
func ElementInSlice ¶
func PathExists ¶
func PathExistsLocal ¶
func TrimSpaceOfStructString ¶
func TrimSpaceOfStructString(in interface{}) error
func ValueInMap ¶
Types ¶
type MySSHConn ¶
func NewMySSHConn ¶
NewMySSHConn returns *MySSHConn and error, first argument is mandatory which presents host ip, and the 3 flowing optional arguments which should be in exact order of port number, user name and user password
func (*MySSHConn) ExecuteCommand ¶
func (*MySSHConn) GetHostName ¶
type MySftpConn ¶
func NewMySftpConn ¶
func NewMySftpConn(hostIp string, in ...interface{}) (sftpConn *MySftpConn, err error)
NewMySftpConn returns *MySftpConn and error, first argument is mandatory which presents host ip, and the 3 flowing optional arguments which should be in exact order of port number, user name and user password
func NewMySftpConnWithDefaultValue ¶
func NewMySftpConnWithDefaultValue(hostIp string) (sftpConn *MySftpConn, err error)
func (*MySftpConn) CloseConn ¶
func (conn *MySftpConn) CloseConn() (err error)
func (*MySftpConn) CopyFileListFromRemote ¶
func (conn *MySftpConn) CopyFileListFromRemote(fileListSource []string, FileDirDest string) (err error)
func (*MySftpConn) CopyFileListFromRemoteWithNewName ¶
func (conn *MySftpConn) CopyFileListFromRemoteWithNewName(fileListSource []string, FileListDest []string) (err error)
func (*MySftpConn) CopySingleFileFromRemote ¶
func (conn *MySftpConn) CopySingleFileFromRemote(fileNameSource string, fileNameDest string) (err error)
func (*MySftpConn) CopySingleFileToRemote ¶
func (conn *MySftpConn) CopySingleFileToRemote(fileNameSource string, fileNameDest string) (err error)
Click to show internal directories.
Click to hide internal directories.