Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // KeyMapping maps keyboard operations to their hotkeys. In the future, this part can be customized by the user configuration. KeyMapping = map[KeyOp]tcell.Key{ KeySourcesOp: tcell.KeyCtrlA, KeySchemasOp: tcell.KeyCtrlS, KeyTablesOp: tcell.KeyCtrlD, KeyPreviewOp: tcell.KeyCtrlE, KeyQueryOp: tcell.KeyCtrlQ, } // TitleSourcesView is the title for Sources view. TitleSourcesView = fmt.Sprintf("Sources [ %s ]", tcell.KeyNames[KeyMapping[KeySourcesOp]]) // TitleSchemasView is the title for Schemas view. TitleSchemasView = fmt.Sprintf("Schemas [ %s ]", tcell.KeyNames[KeyMapping[KeySchemasOp]]) // TitleTablesView is the title for Tables view. TitleTablesView = fmt.Sprintf("Tables [ %s ]", tcell.KeyNames[KeyMapping[KeyTablesOp]]) // TitlePreviewView is the title for Preview view. TitlePreviewView = fmt.Sprintf("Preview [ %s ]", tcell.KeyNames[KeyMapping[KeyPreviewOp]]) // TitleQueryView is the title for Query view. TitleQueryView = fmt.Sprintf("Query [ %s ]", tcell.KeyNames[KeyMapping[KeyQueryOp]]) TitleFooterView = "Navigate [ Tab / Shift-Tab ] · Focus [ Ctrl-F ] · Exit [ Ctrl-C ] \n Tables specific: Describe [ e ] · Preview [ p ]" )
Functions ¶
This section is empty.
Types ¶
type KeyOp ¶
type KeyOp int16
KeyOp defines dbui specific hotkey operations.
const ( // KeySourcesOp is the operation corresponding to the activation of the Sources view. KeySourcesOp KeyOp = iota // KeySchemasOp is the operation corresponding to the activation of the Schemas view. KeySchemasOp // KeyTablesOp is the operation corresponding to the activation of the Tables view. KeyTablesOp // KeyPreviewOp is the operation corresponding to the activation of the Preview view. KeyPreviewOp // KeyQueryOp is the operation corresponding to the activation of the Query view. KeyQueryOp )
type TUI ¶
type TUI struct { // View components. App *tview.Application Grid *tview.Grid Sources *tview.List Schemas *tview.List Tables *tview.List PreviewTable *tview.Table QueryInput *tview.InputField // contains filtered or unexported fields }
TUI implement terminal user interface features. It also provides easy-to-use, easy-to-access abstraction over underlying tview components.
func NewTUI ¶ added in v0.2.0
func NewTUI(appConfig internal.AppConfig, dataController internal.DataController) *TUI
NewTUI configures and returns an instance of terminal user interface.
Click to show internal directories.
Click to hide internal directories.