terminal

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCleanupTick        = time.Minute
	DefaultSessionTTL         = time.Hour
	DefaultIdleTimeout        = 15 * time.Minute
	DefaultMaxSessionsPerUser = 128
	DefaultTerminalCols       = 120
	DefaultTerminalRows       = 36
	DefaultTelnetPort         = 5000
)

Variables

View Source
var (
	ErrSessionNotFound  = errors.New("terminal session not found")
	ErrSessionForbidden = errors.New("terminal session not owned by user")
	ErrSessionAttached  = errors.New("terminal session already has an active client")
	ErrTooManySessions  = errors.New("too many terminal sessions for user")
	ErrSessionExited    = errors.New("terminal session has already exited")
)

Functions

This section is empty.

Types

type CreateSessionOptions

type CreateSessionOptions struct {
	Username      string
	LabName       string
	NodeName      string
	ContainerID   string
	ContainerIP   string
	ContainerKind string
	Runtime       string
	Protocol      models.TerminalProtocol
	Cols          int
	Rows          int
	SSHUsername   string
	TelnetPort    int
}

type Manager

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

func NewManager

func NewManager(cleanupTick, sessionTTL, idleTimeout time.Duration, maxPerUser int) *Manager

func (*Manager) BeginStream

func (m *Manager) BeginStream(sessionID, username string, allowAll bool) (*Session, error)

func (*Manager) CreateSession

func (m *Manager) CreateSession(opts CreateSessionOptions) (*models.TerminalSessionInfo, error)

func (*Manager) GetSessionInfo

func (m *Manager) GetSessionInfo(sessionID, username string, allowAll bool) (*models.TerminalSessionInfo, error)

func (*Manager) Shutdown

func (m *Manager) Shutdown()

func (*Manager) TerminateSession

func (m *Manager) TerminateSession(sessionID, username string, allowAll bool) error

type Session

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

func (*Session) EndStream

func (s *Session) EndStream()

func (*Session) Read

func (s *Session) Read(p []byte) (int, error)

func (*Session) Resize

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

func (*Session) Snapshot

func (s *Session) Snapshot() models.TerminalSessionInfo

func (*Session) Terminate

func (s *Session) Terminate(reason string)

func (*Session) WaitForExit

func (s *Session) WaitForExit(timeout time.Duration) error

func (*Session) WriteInput

func (s *Session) WriteInput(input string) error

Jump to

Keyboard shortcuts

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