server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package server provides session picker UI for SSH and Web servers.

Package server provides SSH server functionality for TERGO.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartSSHServer

func StartSSHServer(ctx context.Context, cfg *SSHServerConfig) error

StartSSHServer initializes and runs the SSH server

Types

type SSHServerConfig

type SSHServerConfig struct {
	Host           string
	Port           string
	KeyPath        string
	DefaultSession string // If set, all connections attach to this session
	Ephemeral      bool   // If true, don't use daemon (old behavior)
	Version        string // For daemon handshake
}

SSHServerConfig holds configuration for the SSH server.

type SessionPicker

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

SessionPicker is a Bubble Tea model for selecting or creating a session.

func NewSessionPicker

func NewSessionPicker(sessions []session.SessionInfo) *SessionPicker

NewSessionPicker creates a new session picker with the given session list.

func (*SessionPicker) Init

func (m *SessionPicker) Init() tea.Cmd

Init implements tea.Model.

func (*SessionPicker) Result

func (m *SessionPicker) Result() *SessionPickerResult

Result returns the user's selection after the picker has quit.

func (*SessionPicker) Update

func (m *SessionPicker) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update implements tea.Model.

func (*SessionPicker) View

func (m *SessionPicker) View() tea.View

View implements tea.Model.

type SessionPickerResult

type SessionPickerResult struct {
	SessionName string // Selected or new session name
	CreateNew   bool   // Whether to create a new session
	Cancelled   bool   // User cancelled the picker
}

SessionPickerResult represents the user's choice from the session picker.

type Window

type Window = terminal.Window

Window is an alias for terminal.Window for use in this package

Jump to

Keyboard shortcuts

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