hub

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package hub is the Bubble Tea model every BBS session lands in (PRD §4.1): it lists registered plugins and routes the session to the selection, reclaiming it when the plugin emits ExitMsg.

Besides in-hub plugins, the hub also lists "session apps" — features that take over the whole terminal (a pod shell, the IRC client, the newsreader, the mail reader, Tor) rather than rendering inside the hub. Selecting one suspends the hub via tea.Exec, runs it, and returns to the menu. This is what lets a member reach everything from a single `ssh <name>@host` login instead of separate `ssh pod@` / `ssh irc@` / `ssh news@` connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

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

Model is the hub menu.

func New

func New(user auth.User, ctx plugin.Context, plugins []plugin.Plugin, apps []SessionApp, banner, motd string) Model

New builds a hub for one session. apps are terminal-takeover features listed after the in-hub plugins (may be nil). banner is an ASCII brand banner and motd a short welcome message; either may be empty.

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

type SessionApp added in v0.1.1

type SessionApp struct {
	Title       string
	Description string
	// Locked, when non-empty, marks the entry visible-but-unavailable (e.g. a
	// paid feature for a free member, or members-only for a guest). The reason
	// is shown when the entry is selected; the app cannot be launched.
	Locked string
	// Cmd is the terminal-takeover command run under tea.Exec.
	Cmd tea.ExecCommand
}

SessionApp is a hub entry that takes over the terminal — a pod shell, the IRC client, the newsreader, the mail reader, or Tor — instead of running as an in-hub model. Selecting it suspends the hub (tea.Exec), runs Cmd, then returns to the menu.

Jump to

Keyboard shortcuts

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