Help us shape the future of Go! Take the 2026 Go Developer Survey

hostmanager

package
v0.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package hostmanager implements the host list / CRUD screen.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model struct {
	Width  int
	Height int
	// contains filtered or unexported fields
}

Model is the host manager screen.

func New

func New(cfg *config.MergedConfig, width, height int) Model

New creates a Model from the current merged config.

func (Model) AcceptsTestResult

func (m Model) AcceptsTestResult(id uint64) bool

AcceptsTestResult reports whether id belongs to the active connection test.

func (*Model) CancelTest

func (m *Model) CancelTest()

CancelTest aborts an in-flight connection test and ignores its result.

func (Model) Init

func (m Model) Init() tea.Cmd

Init implements tea.Model (partial).

func (*Model) OpenPicker

func (m *Model) OpenPicker(targets []config.LinkTarget, names map[string]string)

OpenPicker shows targets grouped by owner. names maps project slugs to the names shown to the user; a slug without one is shown as is.

func (Model) Picking

func (m Model) Picking() bool

Picking reports whether the link picker is open.

func (*Model) Refresh

func (m *Model) Refresh()

Refresh rebuilds the entry list after an external config change.

func (*Model) RetryTest

func (m *Model) RetryTest(host config.Host, challenge tlstrust.Challenge) tea.Cmd

RetryTest repeats a failed test while pinning the certificate shown in the trust prompt for the first reconnect.

func (*Model) SetErr

func (m *Model) SetErr(msg string)

SetErr shows a failed host operation in the status line.

func (*Model) SetSize

func (m *Model) SetSize(w, h int)

SetSize updates terminal dimensions.

func (*Model) SetTrustManager

func (m *Model) SetTrustManager(trust *tlstrust.Manager)

SetTrustManager provides certificate trust for connection tests.

func (Model) StartsNetworkOperation

func (m Model) StartsNetworkOperation(key tea.KeyMsg) bool

StartsNetworkOperation reports whether key would start a connection test.

func (Model) Testing

func (m Model) Testing() (string, *progress.Tracker, bool)

Testing reports whether a connection test is in flight.

func (Model) Update

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

func (Model) View

func (m Model) View() string

type MsgBackToBrowser

type MsgBackToBrowser struct{}

MsgBackToBrowser is sent when the user presses Esc.

type MsgDeleteHost

type MsgDeleteHost struct {
	Name  string
	Scope config.HostScope
}

MsgDeleteHost is sent when a delete is confirmed.

type MsgLinkPickerRequested

type MsgLinkPickerRequested struct{}

MsgLinkPickerRequested asks the root model for the hosts the open project can link to. Reading them means reading every project store, which is the root's business, not the screen's.

type MsgLinkTargetChosen

type MsgLinkTargetChosen struct {
	Target config.LinkTarget
}

MsgLinkTargetChosen is sent when the user picks a host to link. A target of another project has been confirmed for promotion to a global server.

type MsgOpenForm

type MsgOpenForm struct {
	Host      *config.Host     // nil = new host
	Scope     config.HostScope // pre-selected scope for new hosts
	OldName   string           // original name when editing
	Duplicate bool
}

MsgOpenForm is sent when the user wants to create, edit, or duplicate a host.

type MsgTestResult

type MsgTestResult struct {
	Host config.Host
	Err  error
	ID   uint64
}

MsgTestResult carries the outcome of an async connection test.

type MsgTrustReset

type MsgTrustReset struct {
	Host config.Host
	Err  error
}

MsgTrustReset carries the result of removing certificate trust for a host.

Jump to

Keyboard shortcuts

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