jsonview

package
v0.1.0-alpha.68 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 16 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 explores a single JSON value known ahead of time

func ExploreJSONStream

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

ExploreJSONStream explores JSON data loaded incrementally via an iterator

func RenderJSON

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

Types

type AnyIterator

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

An iterator over `any` values

type Iterator

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

A generic iterator interface that is used by the `genericIterator` struct below to convert iterators over specific types to an AnyIterator

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