jsonview

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExploreJSON

func ExploreJSON(title string, json gjson.Result) error

ExploreJSON opens an interactive view for one JSON value.

func ExploreJSONStream

func ExploreJSONStream[T any](title string, it Iterator[T]) error

ExploreJSONStream opens an interactive view for streamed JSON.

func RenderJSON

func RenderJSON(title string, json gjson.Result) string

Types

type AnyIterator

type AnyIterator interface {
	Next() bool
	Err() error
	Current() any
}

AnyIterator iterates over arbitrary values.

type Iterator

type Iterator[T any] interface {
	Next() bool
	Err() error
	Current() T
}

Iterator provides typed iteration.

type JSONView

type JSONView interface {
	GetPath() string
	GetData() gjson.Result
	Update(tea.Msg, bool) tea.Cmd
	View() string
	Resize(width, height int)
}

type JSONViewer

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

func (*JSONViewer) Init

func (v *JSONViewer) Init() tea.Cmd

func (*JSONViewer) Update

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

func (*JSONViewer) View

func (v *JSONViewer) View() string

type TableView

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

func (*TableView) GetData

func (tv *TableView) GetData() gjson.Result

func (*TableView) GetPath

func (tv *TableView) GetPath() string

func (*TableView) Resize

func (tv *TableView) Resize(width, height int)

func (*TableView) Update

func (tv *TableView) Update(msg tea.Msg, raw bool) tea.Cmd

func (*TableView) View

func (tv *TableView) View() string

type TextView

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

func (*TextView) GetData

func (tv *TextView) GetData() gjson.Result

func (*TextView) GetPath

func (tv *TextView) GetPath() string

func (*TextView) Resize

func (tv *TextView) Resize(width, height int)

func (*TextView) Update

func (tv *TextView) Update(msg tea.Msg, raw bool) tea.Cmd

func (*TextView) View

func (tv *TextView) View() string

Jump to

Keyboard shortcuts

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