Documentation
¶
Index ¶
- Variables
- type ActionRequirement
- type CaptureControl
- type CaptureOpener
- type ConnectionCapabilities
- type ConnectionViewProfile
- type ConnectionsClient
- type Model
- func (m Model) Init() tea.Cmd
- func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m Model) View() string
- func (m Model) WithCaptureControl(control *CaptureControl) Model
- func (m Model) WithCaptureHistory(h *history.CaptureHistory) Model
- func (m Model) WithCaptureWriter(w *history.CaptureWriter) Model
- func (m Model) WithConnectionView(profile ConnectionViewProfile) Model
- func (m Model) WithFilter(filter string) Model
- func (m Model) WithReadOnlyActions(message string) Model
- func (m Model) WithTarget(target Target) Model
- type Target
Constants ¶
This section is empty.
Variables ¶
var ( // ActionTargetQueryID requires a query_id before the action can run. ActionTargetQueryID = ActionRequirement{/* contains filtered or unexported fields */} // ActionTargetTransactionID requires a transaction_id before the action can run. ActionTargetTransactionID = ActionRequirement{/* contains filtered or unexported fields */} // ActionTargetConnectionID requires a connection_id before the action can run. ActionTargetConnectionID = ActionRequirement{/* contains filtered or unexported fields */} )
var ( // PostgresConnectionView presents live connections with Postgres session semantics. PostgresConnectionView = ConnectionViewProfile{ // contains filtered or unexported fields } // VitessConnectionView presents live connections with Vitess processlist semantics. VitessConnectionView = ConnectionViewProfile{ // contains filtered or unexported fields } )
Functions ¶
This section is empty.
Types ¶
type ActionRequirement ¶
type ActionRequirement struct {
// contains filtered or unexported fields
}
ActionRequirement describes the row identifier required before an action can be offered for a selected connection. A zero requirement means the action is not available for the connection source.
type CaptureControl ¶
type CaptureControl struct {
Open CaptureOpener
Writer *history.CaptureWriter
Path string
}
func (*CaptureControl) Close ¶
func (c *CaptureControl) Close() error
type CaptureOpener ¶
type CaptureOpener func() (*history.CaptureWriter, string, error)
type ConnectionCapabilities ¶
type ConnectionCapabilities struct {
CancelQuery ActionRequirement
TerminateTransaction ActionRequirement
TerminateConnection ActionRequirement
ShowBlockers bool
// contains filtered or unexported fields
}
ConnectionCapabilities is the TUI capability contract for a connection source. It tells the view which selected-row IDs are needed for each action, whether blocker navigation should be shown, and which action controls should be visible.
It does not execute actions; the model still calls ConnectionsClient. The support value only gates visible controls and validates that the selected row has the identifier the backend expects.
func DefaultConnectionCapabilities ¶
func DefaultConnectionCapabilities() ConnectionCapabilities
DefaultConnectionCapabilities is the Postgres capability set. A zero ConnectionCapabilities also resolves to this default so existing tests and model construction keep Postgres behavior unless a source opts into different capabilities.
type ConnectionViewProfile ¶
type ConnectionViewProfile struct {
// contains filtered or unexported fields
}
func (ConnectionViewProfile) DefaultSort ¶
func (p ConnectionViewProfile) DefaultSort() live.SortMode
DefaultSort is the sort order a connection source should use for this view.
type ConnectionsClient ¶
type ConnectionsClient interface {
List(context.Context, live.SortMode) (live.ConnectionList, error)
CancelQuery(context.Context, live.ActionTarget) error
TerminateTransaction(context.Context, live.ActionTarget) error
TerminateConnection(context.Context, live.ActionTarget) error
}
ConnectionsClient is the live-connections data + action dependency the view model talks to. Production wires this to the wire-level *live.Client (directly or through a filtering wrapper); tests provide a stub that records calls.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubble Tea view model for the interactive table.
func (Model) WithCaptureControl ¶
func (m Model) WithCaptureControl(control *CaptureControl) Model
func (Model) WithCaptureHistory ¶
func (m Model) WithCaptureHistory(h *history.CaptureHistory) Model
WithCaptureHistory replaces the default in-memory ring with one preloaded by the caller, used by replay mode to seed the model with every captured snapshot up front. The cursor points at the latest capture, rendering reflects it immediately, and the model starts paused so the operator controls advance via the step keybindings instead of an auto-tick chewing through the trace.
func (Model) WithCaptureWriter ¶
func (m Model) WithCaptureWriter(w *history.CaptureWriter) Model
WithCaptureWriter persists every successful list to the capture trace file while the TUI runs. Returns the model unchanged when w is nil.
func (Model) WithConnectionView ¶
func (m Model) WithConnectionView(profile ConnectionViewProfile) Model
func (Model) WithFilter ¶
WithFilter records the active row filter (e.g. "filter: role=primary") so the header can show that the view is scoped. Empty when no filter is active.