parser

package
v0.0.0-...-678ef55 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentViewHasPrettyFormat

func ContentViewHasPrettyFormat(objectKey string, content []byte) bool

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

func CreateContentView(commandName string, objectKey string, content []byte) tview.Primitive

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

func CreateErrorView(commandName string, message string) tview.Primitive

CreateErrorView creates a simple error message view

func CreatePrettyContentView

func CreatePrettyContentView(commandName string, objectKey string, content []byte) tview.Primitive

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

Jump to

Keyboard shortcuts

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