ui

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package ui contains the BubbleTea model for pgxcli's interactive prompt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintCmd

func PrintCmd(text string) tea.Cmd

PrintCmd returns a command that prints formatted text.

func PrintErrCmd

func PrintErrCmd(err error) tea.Cmd

PrintErrCmd returns a command that prints a formatted error.

func ShowPagerCmd

func ShowPagerCmd(cmd *exec.Cmd) tea.Cmd

ShowPagerCmd returns a command to execute a pager process.

Types

type ExecCmdMsg

type ExecCmdMsg struct{ Cmd tea.Cmd }

ExecCmdMsg is used to dispatch a batch/sequence of commands.

type Model

type Model struct {
	// contains filtered or unexported fields
}

func New

func New(initialPrefix string, pgKeywords []string, historyFile string, style string, executeFunc execute, cancelFunc cancel) (*Model, error)

func (*Model) Close

func (m *Model) Close() error

func (*Model) Init

func (m *Model) Init() tea.Cmd

func (*Model) Update

func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Model) View

func (m *Model) View() tea.View

type ReadyMsg

type ReadyMsg struct{ Prefix string }

ReadyMsg signals the ui that execution is done and it should prompt.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL