Documentation
¶
Index ¶
- func Connect(mgr *Manager, host, user, keyPath, password string, port int) (string, error)
- type InteractiveManager
- func (im *InteractiveManager) Close(id string) error
- func (im *InteractiveManager) List() []InteractiveSessionInfo
- func (im *InteractiveManager) Open(sshMgr *Manager, sshSessionID string, cols, rows int) (string, error)
- func (im *InteractiveManager) Resize(id string, cols, rows int) error
- func (im *InteractiveManager) Send(id, input string) error
- func (im *InteractiveManager) Subscribe(id string) (<-chan []byte, func(), error)
- type InteractiveSession
- type InteractiveSessionInfo
- type Manager
- type Session
- type SessionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type InteractiveManager ¶ added in v1.0.5
type InteractiveManager struct {
// contains filtered or unexported fields
}
InteractiveManager manages interactive SSH sessions.
func NewInteractiveManager ¶ added in v1.0.5
func NewInteractiveManager() *InteractiveManager
NewInteractiveManager creates a new interactive session manager.
func (*InteractiveManager) Close ¶ added in v1.0.5
func (im *InteractiveManager) Close(id string) error
Close terminates an interactive session.
func (*InteractiveManager) List ¶ added in v1.0.5
func (im *InteractiveManager) List() []InteractiveSessionInfo
List returns information about all active interactive sessions.
func (*InteractiveManager) Open ¶ added in v1.0.5
func (im *InteractiveManager) Open(sshMgr *Manager, sshSessionID string, cols, rows int) (string, error)
Open starts an interactive SSH shell session with PTY allocation on an existing SSH connection managed by the given Manager.
func (*InteractiveManager) Resize ¶ added in v1.0.5
func (im *InteractiveManager) Resize(id string, cols, rows int) error
Resize changes the terminal dimensions for an interactive session.
func (*InteractiveManager) Send ¶ added in v1.0.5
func (im *InteractiveManager) Send(id, input string) error
Send writes input to the interactive session's stdin.
type InteractiveSession ¶ added in v1.0.5
type InteractiveSession struct {
ID string
SSHSessionID string
// contains filtered or unexported fields
}
InteractiveSession wraps an SSH session with PTY allocation for interactive use.
type InteractiveSessionInfo ¶ added in v1.0.5
type InteractiveSessionInfo struct {
ID string `json:"id"`
SSHSessionID string `json:"ssh_session_id"`
Cols int `json:"cols"`
Rows int `json:"rows"`
}
InteractiveSessionInfo holds metadata about an interactive SSH session.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages active SSH sessions.
func (*Manager) Disconnect ¶
Disconnect closes and removes an SSH session.
func (*Manager) List ¶
func (m *Manager) List() []SessionInfo
List returns info about all active sessions.