Documentation ¶
Index ¶
- func Close()
- func GetSSHClient(info *ServerInfo) (*ssh.Client, error)
- func GetSession(info *ServerInfo) (*ssh.Session, error)
- func GetSftpClient(info *ServerInfo) (*sftp.Client, error)
- type BatchCusReader
- type BatchRemoteClient
- func (b *BatchRemoteClient) Close()
- func (b *BatchRemoteClient) CopyDir(localDir, remoteDir string) ([]*ResponseMsg, error)
- func (b *BatchRemoteClient) CopyFile(localFile string, remoteFile string) ([]*ResponseMsg, error)
- func (b *BatchRemoteClient) Exec(cmd string) ([]*ResponseMsg, error)
- func (b *BatchRemoteClient) Foreach(f func(r *RemoteClient) (string, error)) ([]*ResponseMsg, error)
- func (b *BatchRemoteClient) ScpDir(localDir, remoteDir string) ([]*ResponseMsg, error)
- func (b *BatchRemoteClient) ScpFile(localFile string, remoteFile string) ([]*ResponseMsg, error)
- func (b *BatchRemoteClient) UseBashExecScript(remoteFile, script string) ([]*ResponseMsg, error)
- type CusReader
- type RemoteClient
- func (r *RemoteClient) Close()
- func (r *RemoteClient) CopyDir(localDir, remoteDir string) error
- func (r *RemoteClient) CopyFile(localFile string, remoteFile string) error
- func (r *RemoteClient) Exec(cmd string) (string, error)
- func (r *RemoteClient) ExecWithTimeout(cmd string, t time.Duration) (string, error)
- func (r *RemoteClient) ScpDir(localDir, remoteDir string) error
- func (r *RemoteClient) ScpFile(file string, remoteFile string) error
- func (r *RemoteClient) UseBashExecScript(remoteFile, script string) (string, error)
- type ResponseMsg
- type ServerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSSHClient ¶
func GetSSHClient(info *ServerInfo) (*ssh.Client, error)
func GetSession ¶
func GetSession(info *ServerInfo) (*ssh.Session, error)
func GetSftpClient ¶
func GetSftpClient(info *ServerInfo) (*sftp.Client, error)
Types ¶
type BatchCusReader ¶
type BatchCusReader struct {
// contains filtered or unexported fields
}
func NewBatchCusReader ¶
func NewBatchCusReader(serverList []*ServerInfo) (*BatchCusReader, error)
func (*BatchCusReader) Exec ¶
func (b *BatchCusReader) Exec(cmd string) ([]*ResponseMsg, error)
func (*BatchCusReader) ExecGetResult ¶
func (b *BatchCusReader) ExecGetResult() []*ResponseMsg
func (*BatchCusReader) UseBashExecScript ¶
func (b *BatchCusReader) UseBashExecScript(remoteFile, script string) ([]*ResponseMsg, error)
type BatchRemoteClient ¶
type BatchRemoteClient struct {
// contains filtered or unexported fields
}
func NewBatchRemoteClient ¶
func NewBatchRemoteClient(serverList []*ServerInfo) (*BatchRemoteClient, error)
func (*BatchRemoteClient) Close ¶
func (b *BatchRemoteClient) Close()
func (*BatchRemoteClient) CopyDir ¶
func (b *BatchRemoteClient) CopyDir(localDir, remoteDir string) ([]*ResponseMsg, error)
func (*BatchRemoteClient) CopyFile ¶
func (b *BatchRemoteClient) CopyFile(localFile string, remoteFile string) ([]*ResponseMsg, error)
func (*BatchRemoteClient) Exec ¶
func (b *BatchRemoteClient) Exec(cmd string) ([]*ResponseMsg, error)
func (*BatchRemoteClient) Foreach ¶
func (b *BatchRemoteClient) Foreach(f func(r *RemoteClient) (string, error)) ([]*ResponseMsg, error)
func (*BatchRemoteClient) ScpDir ¶
func (b *BatchRemoteClient) ScpDir(localDir, remoteDir string) ([]*ResponseMsg, error)
func (*BatchRemoteClient) ScpFile ¶
func (b *BatchRemoteClient) ScpFile(localFile string, remoteFile string) ([]*ResponseMsg, error)
func (*BatchRemoteClient) UseBashExecScript ¶
func (b *BatchRemoteClient) UseBashExecScript(remoteFile, script string) ([]*ResponseMsg, error)
type CusReader ¶
type CusReader struct { *ServerInfo // contains filtered or unexported fields }
func NewCusReader ¶
func NewCusReader(info *ServerInfo) (*CusReader, error)
func NewCusReaderWithSession ¶
func NewCusReaderWithSession(info *ServerInfo, session *ssh.Session) *CusReader
func (*CusReader) ExecGetResult ¶
func (*CusReader) UseBashExecScript ¶
type RemoteClient ¶
type RemoteClient struct {
*ServerInfo
}
func NewRemoteClient ¶
func NewRemoteClient(info *ServerInfo) (*RemoteClient, error)
func (*RemoteClient) Close ¶
func (r *RemoteClient) Close()
func (*RemoteClient) CopyDir ¶
func (r *RemoteClient) CopyDir(localDir, remoteDir string) error
func (*RemoteClient) CopyFile ¶
func (r *RemoteClient) CopyFile(localFile string, remoteFile string) error
func (*RemoteClient) ExecWithTimeout ¶
func (*RemoteClient) ScpDir ¶
func (r *RemoteClient) ScpDir(localDir, remoteDir string) error
func (*RemoteClient) UseBashExecScript ¶
func (r *RemoteClient) UseBashExecScript(remoteFile, script string) (string, error)
type ResponseMsg ¶
Click to show internal directories.
Click to hide internal directories.