Documentation
¶
Overview ¶
AGPL v3 License Copyright (c) 2026 Project Backplane
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
AGPL v3 License Copyright (c) 2026 Project Backplane
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Registry = map[string]UIStrategy{ "int": &NumericStrategy{}, "bool": &ToggleStrategy{}, "string": &TextStrategy{}, }
StrategyRegistry maps type names to UI strategies
Functions ¶
func MakeHandler ¶
func MakeHandler(b *bridge.Bridge, l *logger.RingLogger, c *stats.Cache) func(ssh.Session) (tea.Model, []tea.ProgramOption)
MakeHandler creates a bubbletea middleware handler with injected dependencies
Types ¶
type EditorModel ¶
Editor Model
func InitialEditor ¶
func InitialEditor(b *bridge.Bridge) EditorModel
func (*EditorModel) Refresh ¶
func (m *EditorModel) Refresh()
func (EditorModel) Update ¶
func (m EditorModel) Update(msg tea.Msg, subject auth.Subject) (EditorModel, tea.Cmd)
func (EditorModel) View ¶
func (m EditorModel) View() string
type NumericStrategy ¶ added in v2.0.1
type NumericStrategy struct{}
NumericStrategy handles integers (inc/dec/edit).
type TextStrategy ¶ added in v2.0.1
type TextStrategy struct{}
TextStrategy handles strings.
type ToggleStrategy ¶ added in v2.0.1
type ToggleStrategy struct{}
ToggleStrategy handles booleans.
type UIStrategy ¶ added in v2.0.1
type UIStrategy interface {
// Render returns the display string for a value.
Render(val interface{}, isEditing bool, inputBuffer string) string
// HandleKey processes a key event for a value.
// Returns (newValue, cmd, doneEditing).
// If newValue is nil, no change occurred (or input buffer was updated).
HandleKey(msg tea.KeyMsg, currentVal interface{}, inputBuffer string, subject auth.Subject) (interface{}, string, bool)
}
UIStrategy defines how a specific type is rendered and edited.