Documentation
¶
Overview ¶
Package interactive implements an interactive command-line interface using the Bubble Tea framework.
Index ¶
- Variables
- func InitialModel() *parentModel
- func InitialModelWithConfig(host, user, password string) *parentModel
- func NewActionModel() actionModel
- func NewBackupExecModel(config ServerConfig, dbName, filename string) backupExecModel
- func NewBackupModel(config ServerConfig) backupModel
- func NewInspectModel(config ServerConfig, bakFileName string) inspectModel
- func NewListFilesModel(config ServerConfig) listFilesModel
- func NewLoginModel(connections []domain.Connection, err error) loginModel
- func NewRestoreExecModel(config ServerConfig, bakFileInfo domain.BackupEntry, newDBName string) restoreExecModel
- func NewRestoreModel(config ServerConfig, fileInfo domain.BackupEntry) restoreModel
- func NewSaveConnectionModel(host, user, password string) saveConnectionModel
- func NewWelcomeModel() templateModel
- func RenderStatusBar(host string, model tea.Model) string
- type ServerConfig
Constants ¶
This section is empty.
Variables ¶
var BorderStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.NormalBorder()). Padding(1, 1). BorderForeground(lipgloss.Color("240"))
var ColHeaderStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#ffffff")). Background(lipgloss.Color("99"))
var DocStyle = lipgloss.NewStyle().Margin(1, 2)
var ErrorTextStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("9"))
var HeadingStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("99")). Bold(true).Align(lipgloss.Center)
var Logo string = `` /* 280-byte string literal not displayed */
var OuterStyle = lipgloss.NewStyle().Margin(0, 2)
var PurpleBgStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#ffffff")). Background(lipgloss.Color("#5E5ED2"))
var TableTitleStyle = PurpleBgStyle.
Padding(0, 1).Margin(0, 2)
Functions ¶
func InitialModel ¶
func InitialModel() *parentModel
InitialModel is the entry point when no config file is available. It loads any persisted connections from disk and shows the login screen.
func InitialModelWithConfig ¶
func InitialModelWithConfig(host, user, password string) *parentModel
InitialModelWithConfig is the entry point when the config file provides a single pre-loaded connection (legacy path kept for backward compatibility). The connection is attempted immediately; on failure the login screen is shown.
func NewActionModel ¶
func NewActionModel() actionModel
func NewBackupExecModel ¶
func NewBackupExecModel(config ServerConfig, dbName, filename string) backupExecModel
func NewBackupModel ¶
func NewBackupModel(config ServerConfig) backupModel
func NewInspectModel ¶
func NewInspectModel(config ServerConfig, bakFileName string) inspectModel
func NewListFilesModel ¶
func NewListFilesModel(config ServerConfig) listFilesModel
func NewLoginModel ¶
func NewLoginModel(connections []domain.Connection, err error) loginModel
NewLoginModel constructs a login screen. connections is the list loaded from the config file; err (if non-nil) is displayed as an error banner.
func NewRestoreExecModel ¶
func NewRestoreExecModel(config ServerConfig, bakFileInfo domain.BackupEntry, newDBName string) restoreExecModel
func NewRestoreModel ¶
func NewRestoreModel(config ServerConfig, fileInfo domain.BackupEntry) restoreModel
func NewSaveConnectionModel ¶ added in v0.2.3
func NewSaveConnectionModel(host, user, password string) saveConnectionModel
NewSaveConnectionModel constructs the model. The name input is pre-filled with "user@host" as a sensible default the user can edit.
func NewWelcomeModel ¶
func NewWelcomeModel() templateModel
Types ¶
type ServerConfig ¶
type ServerConfig struct {
// contains filtered or unexported fields
}
ServerConfig holds the active SQL Server connection credentials.