Documentation ¶
Index ¶
- Constants
- type ISshClient
- type MockSSHUtilsImpl
- func (mssh *MockSSHUtilsImpl) CopyFileToRemote(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, ...) error
- func (mssh *MockSSHUtilsImpl) CopyFileToRemoteConcurrently(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, ...) []Result
- func (mssh *MockSSHUtilsImpl) Execute(sshConfig SSHConfig, cmd string) (string, error)
- func (mssh *MockSSHUtilsImpl) ExecuteConcurrently(sshConfig SSHConfig, cmd string, hostIPs []string) []Result
- type MockSshClient
- func (mssh *MockSshClient) Close(session *ssh.Session) error
- func (mssh *MockSshClient) CombinedOutput(cmd string, session *ssh.Session) ([]byte, error)
- func (mssh *MockSshClient) Dial(network string, addr string, config *ssh.ClientConfig) (*ssh.Client, error)
- func (mssh *MockSshClient) New(files ...string) (ssh.HostKeyCallback, error)
- func (mssh *MockSshClient) NewSession(client *ssh.Client) (*ssh.Session, error)
- func (mssh *MockSshClient) Normalize(address string) string
- func (mssh *MockSshClient) ParsePrivateKey(pemBytes []byte) (ssh.Signer, error)
- func (mssh *MockSshClient) PublicKey(signers ssh.Signer) ssh.AuthMethod
- type Result
- type SSHConfig
- type SSHUtil
- type SSHUtilImpl
- func (s *SSHUtilImpl) AddHostKey(host, known_hosts_path string, remote net.Addr, pubKey ssh.PublicKey) error
- func (s *SSHUtilImpl) CheckKnownHosts(knownHostPath string) (ssh.HostKeyCallback, error)
- func (s *SSHUtilImpl) CopyFileToRemote(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, ...) error
- func (s *SSHUtilImpl) CopyFileToRemoteConcurrently(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, ...) []Result
- func (s *SSHUtilImpl) CreateKnownHosts(knownHostPath string) error
- func (s *SSHUtilImpl) Execute(sshConfig SSHConfig, cmd string) (string, error)
- func (s *SSHUtilImpl) ExecuteConcurrently(sshConfig SSHConfig, cmd string, hostIPs []string) []Result
- func (s *SSHUtilImpl) GetClientConfig(sshConfig SSHConfig) (*ssh.ClientConfig, error)
- func (s *SSHUtilImpl) GetConnection(sshConfig SSHConfig) (*ssh.Client, error)
- func (s *SSHUtilImpl) HostKeyCallback(host string, remote net.Addr, pubkey ssh.PublicKey) error
- type SshClient
- func (sc *SshClient) Close(session *ssh.Session) error
- func (sc *SshClient) CombinedOutput(cmd string, session *ssh.Session) ([]byte, error)
- func (sc *SshClient) Dial(network string, addr string, config *ssh.ClientConfig) (*ssh.Client, error)
- func (sc *SshClient) New(files ...string) (ssh.HostKeyCallback, error)
- func (sc *SshClient) NewSession(conn *ssh.Client) (*ssh.Session, error)
- func (sc *SshClient) Normalize(address string) string
- func (sc *SshClient) ParsePrivateKey(pemBytes []byte) (ssh.Signer, error)
- func (sc *SshClient) PublicKey(signers ssh.Signer) ssh.AuthMethod
Constants ¶
View Source
const AUTOMATE_KNOWN_HOSTS = ".automate_known_hosts"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ISshClient ¶
type ISshClient interface { Dial(network string, addr string, config *ssh.ClientConfig) (*ssh.Client, error) NewSession(*ssh.Client) (*ssh.Session, error) ParsePrivateKey(pemBytes []byte) (ssh.Signer, error) PublicKey(signers ssh.Signer) ssh.AuthMethod CombinedOutput(cmd string, session *ssh.Session) ([]byte, error) Close(*ssh.Session) error Normalize(address string) string New(files ...string) (ssh.HostKeyCallback, error) }
func NewSshClient ¶
func NewSshClient() ISshClient
type MockSSHUtilsImpl ¶
type MockSSHUtilsImpl struct { Executefunc func(sshConfig SSHConfig, cmd string) (string, error) ExecuteConcurrentlyFunc func(sshConfig SSHConfig, cmd string, hostIPs []string) []Result CopyFileToRemoteFunc func(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, removeFile bool) error CopyFileToRemoteConcurrentlyFunc func(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, removeFile bool, hostIPs []string) []Result }
func (*MockSSHUtilsImpl) CopyFileToRemote ¶
func (*MockSSHUtilsImpl) CopyFileToRemoteConcurrently ¶
func (*MockSSHUtilsImpl) Execute ¶
func (mssh *MockSSHUtilsImpl) Execute(sshConfig SSHConfig, cmd string) (string, error)
func (*MockSSHUtilsImpl) ExecuteConcurrently ¶
func (mssh *MockSSHUtilsImpl) ExecuteConcurrently(sshConfig SSHConfig, cmd string, hostIPs []string) []Result
type MockSshClient ¶
type MockSshClient struct { Dialfunc func(network string, addr string, config *ssh.ClientConfig) (*ssh.Client, error) NewSessionfunc func(*ssh.Client) (*ssh.Session, error) ParsePrivateKeyfunc func(pemBytes []byte) (ssh.Signer, error) PublicKeyfunc func(signers ssh.Signer) ssh.AuthMethod CombinedOutputfunc func(cmd string, session *ssh.Session) ([]byte, error) Closefunc func(*ssh.Session) error Normalizefunc func(address string) string Newfunc func(files ...string) (ssh.HostKeyCallback, error) }
func (*MockSshClient) CombinedOutput ¶
func (*MockSshClient) Dial ¶
func (mssh *MockSshClient) Dial(network string, addr string, config *ssh.ClientConfig) (*ssh.Client, error)
func (*MockSshClient) New ¶
func (mssh *MockSshClient) New(files ...string) (ssh.HostKeyCallback, error)
func (*MockSshClient) NewSession ¶
func (*MockSshClient) Normalize ¶
func (mssh *MockSshClient) Normalize(address string) string
func (*MockSshClient) ParsePrivateKey ¶
func (mssh *MockSshClient) ParsePrivateKey(pemBytes []byte) (ssh.Signer, error)
func (*MockSshClient) PublicKey ¶
func (mssh *MockSshClient) PublicKey(signers ssh.Signer) ssh.AuthMethod
type SSHConfig ¶
func NewSshConfig ¶
type SSHUtil ¶
type SSHUtil interface { Execute(sshConfig SSHConfig, cmd string) (string, error) ExecuteConcurrently(sshConfig SSHConfig, cmd string, hostIPs []string) []Result CopyFileToRemote(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, removeFile bool) error CopyFileToRemoteConcurrently(sshConfig SSHConfig, srcFilePath string, destFileName string, destDir string, removeFile bool, hostIPs []string) []Result }
type SSHUtilImpl ¶
type SSHUtilImpl struct { SshClient ISshClient Exec command.Executor // contains filtered or unexported fields }
func NewSSHUtil ¶
func NewSSHUtil(sshclient ISshClient, logger logger.Logger) *SSHUtilImpl
func NewSSHUtilWithCommandExecutor ¶
func NewSSHUtilWithCommandExecutor(sshclient ISshClient, logger logger.Logger, exec command.Executor) *SSHUtilImpl
func (*SSHUtilImpl) AddHostKey ¶
func (*SSHUtilImpl) CheckKnownHosts ¶
func (s *SSHUtilImpl) CheckKnownHosts(knownHostPath string) (ssh.HostKeyCallback, error)
func (*SSHUtilImpl) CopyFileToRemote ¶
func (*SSHUtilImpl) CopyFileToRemoteConcurrently ¶
func (*SSHUtilImpl) CreateKnownHosts ¶
func (s *SSHUtilImpl) CreateKnownHosts(knownHostPath string) error
func (*SSHUtilImpl) Execute ¶
func (s *SSHUtilImpl) Execute(sshConfig SSHConfig, cmd string) (string, error)
func (*SSHUtilImpl) ExecuteConcurrently ¶
func (s *SSHUtilImpl) ExecuteConcurrently(sshConfig SSHConfig, cmd string, hostIPs []string) []Result
func (*SSHUtilImpl) GetClientConfig ¶
func (s *SSHUtilImpl) GetClientConfig(sshConfig SSHConfig) (*ssh.ClientConfig, error)
func (*SSHUtilImpl) GetConnection ¶
func (s *SSHUtilImpl) GetConnection(sshConfig SSHConfig) (*ssh.Client, error)
func (*SSHUtilImpl) HostKeyCallback ¶
type SshClient ¶
type SshClient struct{}
func (*SshClient) CombinedOutput ¶
func (*SshClient) NewSession ¶
func (*SshClient) ParsePrivateKey ¶
Click to show internal directories.
Click to hide internal directories.