menu

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package menu provides an interactive terminal UI for selecting SSH hosts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenderMenu

func RenderMenu(hosts []config.Host) (string, error)

RenderMenu displays an interactive menu for selecting SSH hosts and returns the selected host alias or "exit" if the user chose to quit.

Types

type HostDetails

type HostDetails struct {
	Alias    string
	HostName string
	Details  map[string]string
}

HostDetails contains detailed configuration information for an SSH host.

type HostItem

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

HostItem represents a selectable SSH host item in the list.

func (HostItem) Description

func (i HostItem) Description() string

Description returns the description for the item.

func (HostItem) FilterValue

func (i HostItem) FilterValue() string

FilterValue returns the value used for filtering the item.

func (HostItem) Title

func (i HostItem) Title() string

Title returns the display title for the item.

type Model

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

Model represents the state of the SSH host selection menu.

func NewModel

func NewModel(hosts []config.Host) Model

NewModel creates a new menu model with the given SSH hosts.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the Bubble Tea model.

func (Model) Update

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

Update handles messages and updates the model state.

func (Model) View

func (m Model) View() string

Jump to

Keyboard shortcuts

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