web

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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, 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, progressCh chan<- 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

func (*SSHClient) Close added in v0.95.0

func (c *SSHClient) Close() error

Close closes the SSH connection

func (*SSHClient) Connect added in v0.95.0

func (c *SSHClient) Connect() error

Connect establishes SSH connection to the remote server

func (*SSHClient) NewSession added in v0.95.0

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

NewSession creates a new SSH session

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 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 added in v0.95.0

func CreateSessionHandler(webCfg *config.WebConfig, serverCfg *config.SSHServerConfig, cfg *config.Config, v *viper.Viper, sessionID string, sessionManager *SessionManager, progressCh chan<- string) (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

Jump to

Keyboard shortcuts

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