Documentation
¶
Overview ¶
Copyright © 2024-2026 Daniele Rondina <geaaru@macaronios.org> See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2024-2026 Daniele Rondina <geaaru@macaronios.org> See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2024-2026 Daniele Rondina <geaaru@macaronios.org> See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2024-2026 Daniele Rondina <geaaru@macaronios.org> See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2024-2026 Daniele Rondina <geaaru@macaronios.org> See AUTHORS and LICENSE for the license details and contributors.
Copyright © 2024-2026 Daniele Rondina <geaaru@macaronios.org> See AUTHORS and LICENSE for the license details and contributors.
Index ¶
- func ResizeWindowHandler(sigs chan os.Signal, stdin *os.File, session *core.SshCSession)
- type SshCExecutor
- func (s *SshCExecutor) BuildChain() (*ssh.Client, error)
- func (s *SshCExecutor) Close()
- func (s *SshCExecutor) GetClient() *ssh.Client
- func (s *SshCExecutor) GetConnProtocol() string
- func (e *SshCExecutor) GetEmitter() core.SshCExecutorEmitter
- func (s *SshCExecutor) GetEndpoint() string
- func (s *SshCExecutor) GetHost() string
- func (s *SshCExecutor) GetOption(o string) string
- func (s *SshCExecutor) GetPass() string
- func (s *SshCExecutor) GetPort() int
- func (s *SshCExecutor) GetPrivateKey() string
- func (s *SshCExecutor) GetPrivateKeyPass() string
- func (s *SshCExecutor) GetRuntimeCmdsOutput() bool
- func (s *SshCExecutor) GetSession(n string) (*core.SshCSession, error)
- func (s *SshCExecutor) GetSftpClient() *sftp.Client
- func (s *SshCExecutor) GetShellSession(n, termType string, h, w int, echo bool) (*core.SshCSession, error)
- func (s *SshCExecutor) GetShellSessionWithTermSetup(n, termType string, stdin *os.File, stdout, stderr io.Writer) (*core.SshCSession, TermShellRestoreCb, error)
- func (s *SshCExecutor) GetShowCmdsOutput() bool
- func (s *SshCExecutor) GetUser() string
- func (s *SshCExecutor) RecursiveMkdir(dir string, mode *os.FileMode, uid int, gid int, ensurePerms bool) error
- func (s *SshCExecutor) RecursivePullFile(nodeName, sourcePath, targetPath string, localAsTarget, ensurePerms bool) error
- func (s *SshCExecutor) RecursivePushFile(nodeName, source, target string, ensurePerms bool) error
- func (s *SshCExecutor) RemoveSession(n string) error
- func (s *SshCExecutor) ResetSession(n string) (*core.SshCSession, error)
- func (e *SshCExecutor) RunCommand(nodeName, command string, envs map[string]string, entryPoint []string) (int, error)
- func (e *SshCExecutor) RunCommandWithOutput(nodeName, command string, envs map[string]string, ...) (int, error)
- func (e *SshCExecutor) RunCommandWithOutput4Var(nodeName, command, outVar, errVar string, envs *map[string]string, ...) (int, error)
- func (e *SshCExecutor) RunCommandWithOutputOnCiscoDevice(nodeName, command string, envs map[string]string, ...) (int, error)
- func (e *SshCExecutor) RunCommandWithOutputOnCiscoDeviceWithDS(nodeName, command string, envs map[string]string, ...) (int, error)
- func (e *SshCExecutor) RunHostCommand(command string, envs map[string]string, entryPoint []string) (int, error)
- func (e *SshCExecutor) RunHostCommandWithOutput(command string, envs map[string]string, outBuffer, errBuffer io.WriteCloser, ...) (int, error)
- func (e *SshCExecutor) RunHostCommandWithOutput4Var(command, outVar, errVar string, envs *map[string]string, entryPoint []string) (int, error)
- func (e *SshCExecutor) SetEmitter(emitter core.SshCExecutorEmitter)
- func (s *SshCExecutor) Setup() error
- func (s *SshCExecutor) SetupSftp(opts ...sftp.ClientOption) error
- type TermShellRestoreCb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResizeWindowHandler ¶ added in v0.7.0
Types ¶
type SshCExecutor ¶
type SshCExecutor struct {
Endpoint string
Host string
// Ssh connection protocol. Valid values: tcp,tcp4,tcp6,unix
ConnProtocol string
Port int
TimeoutSecs *uint
ShowCmdsOutput bool
RuntimeCmdsOutput bool
Entrypoint []string
// Cisco Device options
CiscoDevice bool
CiscoPromptRegex bool
CiscoPrompt string
CiscoEnaPrompt string
CiscoEnaPass string
TTYOpISpeed uint32
TTYOpOSpeed uint32
Options map[string]string
User string
Pass string
PrivateKey string
PrivateKeyPass string
Client *ssh.Client
SftpClient *sftp.Client
Sessions map[string]*core.SshCSession
Emitter core.SshCExecutorEmitter
// ConfigDir of SSHC_CONF
ConfigDir string
// Context used to manage all SSL sessions
Ctx context.Context
Cancel context.CancelFunc
TunnelChain []*core.TunnelHop
TunnelLocalPort int
TunnelLocalAddr string
TunnelLocalBind bool
LocalListener net.Listener
LocalListenerWg sync.WaitGroup
}
func NewSshCExecutor ¶
func NewSshCExecutor(endpoint, host string, port int) *SshCExecutor
func NewSshCExecutorFromRemote ¶
func NewSshCExecutorFromRemote(rname string, r *specs.Remote) (*SshCExecutor, error)
func (*SshCExecutor) BuildChain ¶ added in v0.7.0
func (s *SshCExecutor) BuildChain() (*ssh.Client, error)
func (*SshCExecutor) Close ¶
func (s *SshCExecutor) Close()
func (*SshCExecutor) GetClient ¶
func (s *SshCExecutor) GetClient() *ssh.Client
func (*SshCExecutor) GetConnProtocol ¶
func (s *SshCExecutor) GetConnProtocol() string
func (*SshCExecutor) GetEmitter ¶
func (e *SshCExecutor) GetEmitter() core.SshCExecutorEmitter
func (*SshCExecutor) GetEndpoint ¶
func (s *SshCExecutor) GetEndpoint() string
func (*SshCExecutor) GetHost ¶
func (s *SshCExecutor) GetHost() string
func (*SshCExecutor) GetOption ¶ added in v0.8.1
func (s *SshCExecutor) GetOption(o string) string
func (*SshCExecutor) GetPass ¶
func (s *SshCExecutor) GetPass() string
func (*SshCExecutor) GetPort ¶
func (s *SshCExecutor) GetPort() int
func (*SshCExecutor) GetPrivateKey ¶
func (s *SshCExecutor) GetPrivateKey() string
func (*SshCExecutor) GetPrivateKeyPass ¶
func (s *SshCExecutor) GetPrivateKeyPass() string
func (*SshCExecutor) GetRuntimeCmdsOutput ¶
func (s *SshCExecutor) GetRuntimeCmdsOutput() bool
func (*SshCExecutor) GetSession ¶
func (s *SshCExecutor) GetSession(n string) (*core.SshCSession, error)
func (*SshCExecutor) GetSftpClient ¶
func (s *SshCExecutor) GetSftpClient() *sftp.Client
func (*SshCExecutor) GetShellSession ¶
func (s *SshCExecutor) GetShellSession(n, termType string, h, w int, echo bool) (*core.SshCSession, error)
func (*SshCExecutor) GetShellSessionWithTermSetup ¶
func (s *SshCExecutor) GetShellSessionWithTermSetup(n, termType string, stdin *os.File, stdout, stderr io.Writer) (*core.SshCSession, TermShellRestoreCb, error)
func (*SshCExecutor) GetShowCmdsOutput ¶
func (s *SshCExecutor) GetShowCmdsOutput() bool
func (*SshCExecutor) GetUser ¶
func (s *SshCExecutor) GetUser() string
func (*SshCExecutor) RecursiveMkdir ¶
func (*SshCExecutor) RecursivePullFile ¶
func (s *SshCExecutor) RecursivePullFile(nodeName, sourcePath, targetPath string, localAsTarget, ensurePerms bool) error
func (*SshCExecutor) RecursivePushFile ¶
func (s *SshCExecutor) RecursivePushFile(nodeName, source, target string, ensurePerms bool) error
func (*SshCExecutor) RemoveSession ¶
func (s *SshCExecutor) RemoveSession(n string) error
func (*SshCExecutor) ResetSession ¶
func (s *SshCExecutor) ResetSession(n string) (*core.SshCSession, error)
func (*SshCExecutor) RunCommand ¶
func (*SshCExecutor) RunCommandWithOutput ¶
func (e *SshCExecutor) RunCommandWithOutput(nodeName, command string, envs map[string]string, outBuffer, errBuffer io.WriteCloser, entryPoint []string) (int, error)
func (*SshCExecutor) RunCommandWithOutput4Var ¶
func (*SshCExecutor) RunCommandWithOutputOnCiscoDevice ¶ added in v0.8.0
func (e *SshCExecutor) RunCommandWithOutputOnCiscoDevice(nodeName, command string, envs map[string]string, outBuffer, errBuffer io.WriteCloser, entryPoint []string) (int, error)
func (*SshCExecutor) RunCommandWithOutputOnCiscoDeviceWithDS ¶ added in v0.8.1
func (e *SshCExecutor) RunCommandWithOutputOnCiscoDeviceWithDS(nodeName, command string, envs map[string]string, outBuffer, errBuffer io.WriteCloser, entryPoint []string, opts *core.CiscoCommandOpts) (int, error)
func (*SshCExecutor) RunHostCommand ¶
func (*SshCExecutor) RunHostCommandWithOutput ¶
func (e *SshCExecutor) RunHostCommandWithOutput(command string, envs map[string]string, outBuffer, errBuffer io.WriteCloser, entryPoint []string) (int, error)
func (*SshCExecutor) RunHostCommandWithOutput4Var ¶
func (*SshCExecutor) SetEmitter ¶
func (e *SshCExecutor) SetEmitter(emitter core.SshCExecutorEmitter)
func (*SshCExecutor) Setup ¶
func (s *SshCExecutor) Setup() error
func (*SshCExecutor) SetupSftp ¶
func (s *SshCExecutor) SetupSftp(opts ...sftp.ClientOption) error
type TermShellRestoreCb ¶
type TermShellRestoreCb func() error