Documentation
¶
Overview ¶
Package hostmanager implements the host list / CRUD screen.
Index ¶
- type Model
- func (m Model) AcceptsTestResult(id uint64) bool
- func (m *Model) CancelTest()
- func (m Model) Init() tea.Cmd
- func (m *Model) OpenPicker(targets []config.LinkTarget, names map[string]string)
- func (m Model) Picking() bool
- func (m *Model) Refresh()
- func (m *Model) RetryTest(host config.Host, challenge tlstrust.Challenge) tea.Cmd
- func (m *Model) SetErr(msg string)
- func (m *Model) SetSize(w, h int)
- func (m *Model) SetTrustManager(trust *tlstrust.Manager)
- func (m Model) StartsNetworkOperation(key tea.KeyMsg) bool
- func (m Model) Testing() (string, *progress.Tracker, bool)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- type MsgBackToBrowser
- type MsgDeleteHost
- type MsgLinkPickerRequested
- type MsgLinkTargetChosen
- type MsgOpenForm
- type MsgTestResult
- type MsgTrustReset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
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 ¶
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) 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) Refresh ¶
func (m *Model) Refresh()
Refresh rebuilds the entry list after an external config change.
func (*Model) RetryTest ¶
RetryTest repeats a failed test while pinning the certificate shown in the trust prompt for the first reconnect.
func (*Model) SetTrustManager ¶
SetTrustManager provides certificate trust for connection tests.
func (Model) StartsNetworkOperation ¶
StartsNetworkOperation reports whether key would start a connection test.
type MsgBackToBrowser ¶
type MsgBackToBrowser struct{}
MsgBackToBrowser is sent when the user presses Esc.
type MsgDeleteHost ¶
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 ¶
MsgTestResult carries the outcome of an async connection test.
type MsgTrustReset ¶
MsgTrustReset carries the result of removing certificate trust for a host.