Documentation
¶
Index ¶
- type Model
- type ModelOption
- func WithContext(ctx context.Context) ModelOption
- func WithCredentialPersistenceUnavailable(unavailable bool) ModelOption
- func WithCredentialRegistry(reg *credential.Registry) ModelOption
- func WithCredentialService(svc *credential.Service) ModelOption
- func WithInteractionHandler(interaction ssh.InteractionHandler) ModelOption
- func WithLogger(l logger.DebugLogger) ModelOption
- func WithRememberConfirmation(confirm func(context.Context, string) (bool, error)) ModelOption
- func WithRememberPolicy(policy string) ModelOption
- func WithVaultControl(control func(context.Context, bool) error) ModelOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
func NewModel ¶
func NewModel(repository *config.Repository, opts ...ModelOption) (Model, error)
NewModel initializes the TUI model. Package components use a no-op logger unless the CLI composition root explicitly supplies one with WithLogger.
type ModelOption ¶ added in v0.12.0
type ModelOption func(*modelConfig)
ModelOption configures dependencies used by a TUI model.
func WithContext ¶ added in v0.12.0
func WithContext(ctx context.Context) ModelOption
WithContext injects the lifetime context for TUI-owned I/O and goroutines.
func WithCredentialPersistenceUnavailable ¶ added in v0.12.0
func WithCredentialPersistenceUnavailable(unavailable bool) ModelOption
WithCredentialPersistenceUnavailable keeps connections usable when the CLI cannot initialize automatic saving. Explicit credential edits still fail.
func WithCredentialRegistry ¶ added in v0.12.0
func WithCredentialRegistry(reg *credential.Registry) ModelOption
WithCredentialRegistry injects the credential registry used to resolve stored secrets for SSH.
func WithCredentialService ¶ added in v0.12.0
func WithCredentialService(svc *credential.Service) ModelOption
WithCredentialService injects the credential service used for secure secret management.
func WithInteractionHandler ¶ added in v0.12.0
func WithInteractionHandler(interaction ssh.InteractionHandler) ModelOption
WithInteractionHandler injects SSH prompts run while Bubble Tea has released its terminal. Handlers must not wait on the paused TUI event loop.
func WithLogger ¶ added in v0.12.0
func WithLogger(l logger.DebugLogger) ModelOption
WithLogger injects the debug logger used by TUI-owned package components.
func WithRememberConfirmation ¶ added in v0.12.0
WithRememberConfirmation supplies the UI decision for remember_prompted: ask. Without a confirmer, ask remains session-only. The callback runs with the terminal released and must respect context cancellation.
func WithRememberPolicy ¶ added in v0.12.0
func WithRememberPolicy(policy string) ModelOption
WithRememberPolicy overrides automatic recording for this TUI invocation. Explicit credential form edits remain available under never.
func WithVaultControl ¶ added in v0.12.0
func WithVaultControl(control func(context.Context, bool) error) ModelOption
WithVaultControl injects process-local lock/unlock actions. Unlock runs with Bubble Tea's terminal released; no master password enters the model state.