Documentation
¶
Index ¶
- type LocalPTYSession
- type RemoteInstaller
- type SSHClient
- type SSHSession
- type Session
- type SessionEntry
- type SessionHandler
- type SessionManager
- func (sm *SessionManager) ActiveSessionCount() int
- func (sm *SessionManager) CreateSession(sessionID string) Session
- func (sm *SessionManager) GetScreenshotPort(sessionID string) (int, bool)
- func (sm *SessionManager) RegisterSession(sessionID string, session Session)
- func (sm *SessionManager) RemoveSession(sessionID string)
- func (sm *SessionManager) SetScreenshotPort(sessionID string, port int)
- func (sm *SessionManager) Shutdown()
- func (sm *SessionManager) UpdateActivity(sessionID string)
- func (sm *SessionManager) WrapSession(sessionID string, session Session) *SessionWrapper
- type SessionWrapper
- type WebTerminalServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalPTYSession ¶
type LocalPTYSession struct {
// contains filtered or unexported fields
}
LocalPTYSession represents a single local terminal session
func NewLocalPTYSession ¶
func NewLocalPTYSession(cfg *config.Config, v *viper.Viper) *LocalPTYSession
func (*LocalPTYSession) Close ¶ added in v0.95.0
func (s *LocalPTYSession) Close() error
Close terminates the PTY session
func (*LocalPTYSession) HandleConnection ¶
func (s *LocalPTYSession) HandleConnection(conn *websocket.Conn) error
func (*LocalPTYSession) Resize ¶ added in v0.95.0
func (s *LocalPTYSession) Resize(cols, rows int) error
Resize changes the PTY window size
func (*LocalPTYSession) Start ¶
func (s *LocalPTYSession) Start(cols, rows int) error
func (*LocalPTYSession) Stop ¶
func (s *LocalPTYSession) Stop() error
Stop is deprecated, use Close instead
type RemoteInstaller ¶ added in v0.95.0
type RemoteInstaller struct {
// contains filtered or unexported fields
}
RemoteInstaller handles auto-installation of infer binary on remote servers
func NewRemoteInstaller ¶ added in v0.95.0
func NewRemoteInstaller(client *SSHClient, cfg *config.WebSSHConfig, server *config.SSHServerConfig, gatewayURL string) *RemoteInstaller
NewRemoteInstaller creates a new remote installer
func (*RemoteInstaller) EnsureBinary ¶ added in v0.95.0
func (i *RemoteInstaller) EnsureBinary() error
EnsureBinary checks if infer exists on remote server, installs if missing
type SSHClient ¶ added in v0.95.0
type SSHClient struct {
// contains filtered or unexported fields
}
SSHClient manages SSH connections to remote servers
func NewSSHClient ¶ added in v0.95.0
func NewSSHClient(cfg *config.WebSSHConfig, server *config.SSHServerConfig) (*SSHClient, error)
NewSSHClient creates an SSH client for the specified server
type SSHSession ¶ added in v0.95.0
type SSHSession struct {
// contains filtered or unexported fields
}
SSHSession wraps an SSH session with PTY for remote terminal access
func NewSSHSession ¶ added in v0.95.0
func NewSSHSession(client *SSHClient, server *config.SSHServerConfig, gatewayURL string, sessionID string, sessionManager *SessionManager) (*SSHSession, error)
NewSSHSession creates a new SSH session with PTY
func (*SSHSession) Close ¶ added in v0.95.0
func (s *SSHSession) Close() error
Close terminates the SSH session
func (*SSHSession) HandleConnection ¶ added in v0.95.0
func (s *SSHSession) HandleConnection(conn *websocket.Conn) error
HandleConnection bridges WebSocket and SSH session I/O
func (*SSHSession) Resize ¶ added in v0.95.0
func (s *SSHSession) Resize(cols, rows int) error
Resize changes the PTY window size
func (*SSHSession) SetupPortForwarding ¶ added in v0.96.0
func (s *SSHSession) SetupPortForwarding(remotePort int) (int, error)
SetupPortForwarding sets up SSH port forwarding from local to remote port
func (*SSHSession) Start ¶ added in v0.95.0
func (s *SSHSession) Start(cols, rows int) error
Start executes "infer chat" on the remote server with PTY
type SessionEntry ¶
type SessionEntry struct {
// contains filtered or unexported fields
}
SessionEntry tracks a session and its activity
type SessionHandler ¶
type SessionHandler interface {
Start(cols, rows int) error
Resize(cols, rows int) error
HandleConnection(conn *websocket.Conn) error
Close() error
}
SessionHandler interface for both local PTY and remote SSH sessions
func CreateSessionHandler ¶ added in v0.95.0
func CreateSessionHandler(webCfg *config.WebConfig, serverCfg *config.SSHServerConfig, cfg *config.Config, v *viper.Viper, sessionID string, sessionManager *SessionManager) (SessionHandler, error)
CreateSessionHandler creates either a local PTY session or remote SSH session
type SessionManager ¶
type SessionManager struct {
// contains filtered or unexported fields
}
SessionManager tracks and manages all active sessions
func NewSessionManager ¶
func NewSessionManager(cfg *config.Config, v *viper.Viper) *SessionManager
func (*SessionManager) ActiveSessionCount ¶
func (sm *SessionManager) ActiveSessionCount() int
ActiveSessionCount returns the number of currently active sessions
func (*SessionManager) CreateSession ¶
func (sm *SessionManager) CreateSession(sessionID string) Session
CreateSession creates a new session and registers it
func (*SessionManager) GetScreenshotPort ¶ added in v0.96.0
func (sm *SessionManager) GetScreenshotPort(sessionID string) (int, bool)
GetScreenshotPort retrieves the local screenshot port for a session
func (*SessionManager) RegisterSession ¶ added in v0.96.0
func (sm *SessionManager) RegisterSession(sessionID string, session Session)
RegisterSession registers an existing session with the manager
func (*SessionManager) RemoveSession ¶
func (sm *SessionManager) RemoveSession(sessionID string)
RemoveSession removes and stops a session
func (*SessionManager) SetScreenshotPort ¶ added in v0.96.0
func (sm *SessionManager) SetScreenshotPort(sessionID string, port int)
SetScreenshotPort sets the local screenshot port for a session
func (*SessionManager) Shutdown ¶
func (sm *SessionManager) Shutdown()
Shutdown stops all sessions and the cleanup goroutine
func (*SessionManager) UpdateActivity ¶
func (sm *SessionManager) UpdateActivity(sessionID string)
UpdateActivity updates the last activity time for a session
func (*SessionManager) WrapSession ¶
func (sm *SessionManager) WrapSession(sessionID string, session Session) *SessionWrapper
type SessionWrapper ¶ added in v0.95.0
type SessionWrapper struct {
// contains filtered or unexported fields
}
SessionWrapper wraps a session to track activity
func (*SessionWrapper) HandleConnection ¶ added in v0.95.0
func (sh *SessionWrapper) HandleConnection(conn *websocket.Conn) error
type WebTerminalServer ¶
type WebTerminalServer struct {
// contains filtered or unexported fields
}
func NewWebTerminalServer ¶
func NewWebTerminalServer(cfg *config.Config, v *viper.Viper) *WebTerminalServer
func (*WebTerminalServer) Start ¶
func (s *WebTerminalServer) Start() error