Documentation
¶
Overview ¶
Package fleet renders a live, one-row-per-host overview of all registered servers, collecting metrics from each concurrently. Press Enter on a host to drill into its full dashboard and Esc/q to return (wired by cmd/kay via RunView); the overview itself is read-only.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Interval time.Duration
Color string
Anonymize bool // mask aliases/hosts (for demos/screenshots)
}
Options configures the fleet view.
type Selection ¶ added in v0.2.0
Selection is the host a user chose to drill into, together with its live persistent connection so the dashboard can reuse it — running its metrics over the same transport — instead of opening a second one. The connection keeps self-healing in the background, so the dashboard needs no separate redial.
type Session ¶ added in v0.2.0
type Session struct {
// contains filtered or unexported fields
}
Session owns one persistent, self-healing SSH connection per host and keeps them alive across repeated RunView calls, so drilling into a host's dashboard and back never re-handshakes. The caller (cmd/kay) creates one Session for the whole interactive session and Closes it at the end.
func NewSession ¶ added in v0.2.0
NewSession registers every host with a fresh connection pool and starts connecting to all of them in the background (dial concurrency is capped).
func (*Session) Close ¶ added in v0.2.0
func (s *Session) Close()
Close tears down every connection in the pool.
func (*Session) RunView ¶ added in v0.2.0
func (s *Session) RunView(scr *tui.Screen, events <-chan tui.Event, opts Options) (*Selection, error)
RunView runs the fleet overview against an already-open screen and a shared input channel, reusing the session's persistent connections. It returns the host the user selected with Enter (with its live connection to reuse), or nil when they quit.