inspectview

package
v1.13.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const ViewName = "inspect"

Variables

This section is empty.

Functions

func LoadInspectItem

func LoadInspectItem(title, jsonStr string) tea.Cmd

LoadInspectItem returns a cmd that sends a Msg(title, json)

Types

type Format

type Format string
const (
	FormatYAML Format = "yml"
	FormatRaw  Format = "raw"
)

func ParseFormat

func ParseFormat(v any) Format

type Model

type Model struct {
	Root       *Node
	Title      string
	SearchTerm string

	Format     Format // "yml" or "raw"
	RawContent string
	ParseError string
	// contains filtered or unexported fields
}

func New

func New(width, height int, format Format) *Model

func (*Model) ApplySearchQuery

func (m *Model) ApplySearchQuery(query string)

ApplySearchQuery implements view.Filterable — sets the app-level "/" filter.

func (*Model) ClearSearchQuery

func (m *Model) ClearSearchQuery()

ClearSearchQuery implements view.Filterable — clears the app-level "/" filter.

func (*Model) FrameContent

func (m *Model) FrameContent() string

func (*Model) FrameFooter

func (m *Model) FrameFooter() string

func (*Model) FrameHeader

func (m *Model) FrameHeader() string

func (*Model) FrameTitle

func (m *Model) FrameTitle() string

func (*Model) HasActiveFilter

func (m *Model) HasActiveFilter() bool

HasActiveFilter returns true when the app-level "/" filter is active.

func (*Model) HasErrors

func (m *Model) HasErrors() bool

func (*Model) Init

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

func (*Model) IsSearching

func (m *Model) IsSearching() bool

IsSearching returns true when the ctrl+f search input is active.

func (*Model) Name

func (m *Model) Name() string

func (*Model) OnEnter

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

func (*Model) OnExit

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

func (*Model) SetContent

func (m *Model) SetContent(content string)

func (*Model) SetFormat

func (m *Model) SetFormat(format Format)

func (*Model) SetTitle

func (m *Model) SetTitle(t string)

func (*Model) ShortHelpItems

func (m *Model) ShortHelpItems() []helpbar.HelpEntry

func (*Model) Update

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

func (*Model) View

func (m *Model) View() string

type Msg

type Msg struct {
	Title   string
	Content string
}

type Node

type Node struct {
	Key      string
	Raw      any
	ValueStr string
	Children []*Node
	Parent   *Node
}

func ParseJSON

func ParseJSON(jsonStr string) (*Node, error)

Jump to

Keyboard shortcuts

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