Help us shape the future of Go! Take the 2026 Go Developer Survey

web

package
v0.233.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

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) *LocalPTYSession

func (*LocalPTYSession) Close

func (s *LocalPTYSession) Close() error

Close terminates the PTY session

func (*LocalPTYSession) HandleConnection

func (s *LocalPTYSession) HandleConnection(conn *websocket.Conn) error

func (*LocalPTYSession) Resize

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

type RemoteInstaller

type RemoteInstaller struct {
	// contains filtered or unexported fields
}

RemoteInstaller handles auto-installation of infer binary on remote servers

func NewRemoteInstaller

func NewRemoteInstaller(client *SSHClient, cfg *config.WebSSHConfig, server *config.SSHServerConfig, gatewayURL string, progressCh chan<- string) *RemoteInstaller

NewRemoteInstaller creates a new remote installer

func (*RemoteInstaller) EnsureBinary

func (i *RemoteInstaller) EnsureBinary() error

EnsureBinary checks if infer exists on remote server, installs if missing

type SSHClient

type SSHClient struct {
	// contains filtered or unexported fields
}

SSHClient manages SSH connections to remote servers

func NewSSHClient

func NewSSHClient(cfg *config.WebSSHConfig, server *config.SSHServerConfig) (*SSHClient, error)

NewSSHClient creates an SSH client for the specified server

func (*SSHClient) Close

func (c *SSHClient) Close() error

Close closes the SSH connection

func (*SSHClient) Connect

func (c *SSHClient) Connect() error

Connect establishes SSH connection to the remote server

func (*SSHClient) NewSession

func (c *SSHClient) NewSession() (*ssh.Session, error)

NewSession creates a new SSH session

type SSHSession

type SSHSession struct {
	// contains filtered or unexported fields
}

SSHSession wraps an SSH session with PTY for remote terminal access

func NewSSHSession

func NewSSHSession(client *SSHClient, server *config.SSHServerConfig, gatewayURL string, sessionID string, sessionManager *Sessions) (*SSHSession, error)

NewSSHSession creates a new SSH session with PTY

func (*SSHSession) Close

func (s *SSHSession) Close() error

Close terminates the SSH session

func (*SSHSession) HandleConnection

func (s *SSHSession) HandleConnection(conn *websocket.Conn) error

HandleConnection bridges WebSocket and SSH session I/O

func (*SSHSession) Resize

func (s *SSHSession) Resize(cols, rows int) error

Resize changes the PTY window size

func (*SSHSession) SetupPortForwarding

func (s *SSHSession) SetupPortForwarding(remotePort int) (int, error)

SetupPortForwarding sets up SSH port forwarding from local to remote port

func (*SSHSession) Start

func (s *SSHSession) Start(cols, rows int) error

Start executes "infer chat" on the remote server with PTY

type Session

type Session = SessionHandler

Session is an alias for backward compatibility

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

func CreateSessionHandler(webCfg *config.WebConfig, serverCfg *config.SSHServerConfig, cfg *config.Config, sessionID string, sessionManager *Sessions, progressCh chan<- string) (SessionHandler, error)

CreateSessionHandler creates either a local PTY session or remote SSH session

type SessionWrapper

type SessionWrapper struct {
	// contains filtered or unexported fields
}

SessionWrapper wraps a session to track activity

func (*SessionWrapper) HandleConnection

func (sh *SessionWrapper) HandleConnection(conn *websocket.Conn) error

type Sessions added in v0.207.0

type Sessions struct {
	// contains filtered or unexported fields
}

Sessions tracks and manages all active sessions

func NewSessions added in v0.207.0

func NewSessions(cfg *config.Config) *Sessions

func (*Sessions) ActiveSessionCount added in v0.207.0

func (sm *Sessions) ActiveSessionCount() int

ActiveSessionCount returns the number of currently active sessions

func (*Sessions) GetScreenshotPort added in v0.207.0

func (sm *Sessions) GetScreenshotPort(sessionID string) (int, bool)

GetScreenshotPort retrieves the local screenshot port for a session

func (*Sessions) RegisterSession added in v0.207.0

func (sm *Sessions) RegisterSession(sessionID string, session Session)

RegisterSession registers an existing session with the manager

func (*Sessions) RemoveSession added in v0.207.0

func (sm *Sessions) RemoveSession(sessionID string)

RemoveSession removes and stops a session

func (*Sessions) SetScreenshotPort added in v0.207.0

func (sm *Sessions) SetScreenshotPort(sessionID string, port int)

SetScreenshotPort sets the local screenshot port for a session

func (*Sessions) Shutdown added in v0.207.0

func (sm *Sessions) Shutdown()

Shutdown stops all sessions and the cleanup goroutine. Call exactly once: a second call panics on close of the done channel.

func (*Sessions) UpdateActivity added in v0.207.0

func (sm *Sessions) UpdateActivity(sessionID string)

UpdateActivity updates the last activity time for a session

func (*Sessions) WrapSession added in v0.207.0

func (sm *Sessions) WrapSession(sessionID string, session Session) *SessionWrapper

type WebTerminalServer

type WebTerminalServer struct {
	// contains filtered or unexported fields
}

func NewWebTerminalServer

func NewWebTerminalServer(cfg *config.Config) *WebTerminalServer

func (*WebTerminalServer) Start

func (s *WebTerminalServer) Start() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL