Documentation
¶
Overview ¶
Package ui contains terminal UI flows used by the CLI.
Package ui contains the BubbleTea model for pgxcli's interactive prompt.
Index ¶
- func Banner(version string) string
- func PrintCmd(text string, style lipgloss.Style) tea.Cmd
- func PrintErrCmd(err error, style lipgloss.Style) tea.Cmd
- func ShowPagerCmd(cmd *exec.Cmd) tea.Cmd
- type ConfirmQuitMsg
- type ConnectionValues
- type ExecCmdMsg
- type KeyMap
- type Model
- type QuitRequestMsg
- type ReadyMsg
- type State
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintErrCmd ¶
PrintErrCmd returns a command that prints a formatted error.
Types ¶
type ConfirmQuitMsg ¶ added in v0.2.0
type ConfirmQuitMsg struct{}
ConfirmQuitMsg is used internally to finalize quitting.
type ConnectionValues ¶ added in v0.2.0
type ConnectionValues struct {
Database string
Username string
Port string
Host string
Password string
}
ConnectionValues contains connection details collected from the interactive form.
func RunConnectionForm ¶ added in v0.2.0
func RunConnectionForm(database, username, host, port string) (ConnectionValues, error)
RunConnectionForm starts the interactive connection form and returns collected values.
type ExecCmdMsg ¶
ExecCmdMsg is used to dispatch a batch/sequence of commands.
type KeyMap ¶ added in v0.2.0
KeyMap defines the keybindings for the application.
func DefaultKeyMap ¶ added in v0.2.0
func DefaultKeyMap() KeyMap
DefaultKeyMap returns the default keybindings.
type QuitRequestMsg ¶ added in v0.2.0
type QuitRequestMsg struct{}
QuitRequestMsg signals that the app wants to quit.
type ReadyMsg ¶
type ReadyMsg struct{ Prefix string }
ReadyMsg signals the ui that execution is done and it should prompt.
type Styles ¶ added in v0.2.0
type Styles struct {
// UserInput styles the user's input query after enter key is pressed.
UserInput lipgloss.Style
// AppOutput styles the output from the application after executing the query.
AppOutput lipgloss.Style
// ErrorOutput styles the error output from the application after executing the query.
ErrorOutput lipgloss.Style
// UserInputSepartor styles the separator between user input from previous result.
UserInputSepartor lipgloss.Style
// InputSeparator is a top and bottom border for editline input area.
InputSeparator lipgloss.Style
// Spinner styles the spinner animation.
Spinner lipgloss.Style
SpinnerCaption lipgloss.Style
// StatusBar styles the status bar at the bottom.
StatusBar lipgloss.Style
}
func DefaultStyles ¶ added in v0.2.0
func DefaultStyles() Styles