Documentation
¶
Index ¶
- func ContentViewHasPrettyFormat(objectKey string, content []byte) bool
- func CreateContentView(commandName string, objectKey string, content []byte) tview.Primitive
- func CreateErrorView(commandName string, message string) tview.Primitive
- func CreatePrettyContentView(commandName string, objectKey string, content []byte) tview.Primitive
- func ParseToObject(viewType string, parsedResult ParseCommandResult, command cmd.Command, ...) tview.Primitive
- type ParseCommandResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentViewHasPrettyFormat ¶
ContentViewHasPrettyFormat returns true if the content type supports a pretty/structured view that is different from the raw text view. Used to decide whether to show the 'v' toggle shortcut.
func CreateContentView ¶
CreateContentView creates the default view for downloaded file content. Images are rendered with tview.Image; everything else is shown as raw text. Use CreatePrettyContentView to get the formatted/structured view.
func CreateErrorView ¶
CreateErrorView creates a simple error message view
func CreatePrettyContentView ¶
CreatePrettyContentView creates a structured/formatted view for downloaded file content. Routes to the appropriate viewer based on detected content type: - Images: rendered with tview.Image (same as raw) - JSON: interactive tree view - JSONL/NDJSON: table with one row per JSON line - YAML: parsed to map, then rendered as tree view - CSV/TSV: parsed and rendered as a table - Everything else: plain text (same as raw)
func ParseToObject ¶
func ParseToObject(viewType string, parsedResult ParseCommandResult, command cmd.Command, commandHandler func(selectedProfileName string), app *tview.Application, restoreRootView func(), createHeader func() *tview.Flex, createFooter func([]string) *tview.Table, logView *tview.TextView, isLogEnabled bool) tview.Primitive
Types ¶
type ParseCommandResult ¶
type ParseCommandResult struct {
Command string
Header []string
Values [][]string
RawData []interface{}
RawOutput string
}
func ParseCommand ¶
func ParseCommand(command cmd.Command, commandOutput string) ParseCommandResult