Documentation
¶
Index ¶
- Variables
- func ApplySyntaxHighlightingToLine(line string, isYAML bool) string
- func ApplyTableStyles(t table.Model) table.Model
- func ColorizeHARTableOutput(tableView string, cursor int, rows []table.Row) string
- func HighlightJSONLine(line string) string
- func HighlightYAMLKeyValue(line string) (string, bool)
- func RenderJSONWithSearch(content string, query string, keysOnly bool, filtered bool, width int) string
- type EntryFilter
- type FileTypeFilter
- func (f *FileTypeFilter) Clear()
- func (f *FileTypeFilter) ExcludeCategory(category string)
- func (f *FileTypeFilter) IncludeCategory(category string)
- func (f *FileTypeFilter) IsActive() bool
- func (f *FileTypeFilter) ShouldShow(index int, metadata *motor.EntryMetadata) bool
- func (f *FileTypeFilter) ToggleCategory(category string, include bool)
- type FilterChain
- type HARViewModel
- type JSONMatch
- type JSONRenderer
- type JSONSearchEngine
- func (e *JSONSearchEngine) FilterJSON(includeParents bool) (interface{}, error)
- func (e *JSONSearchEngine) GetMatchedPaths() []string
- func (e *JSONSearchEngine) IsParentPath(path string) bool
- func (e *JSONSearchEngine) IsPathMatched(path string) bool
- func (e *JSONSearchEngine) Search(query string, keysOnly bool) []JSONMatch
- type KeyValuePair
- type LoadState
- type ModalType
- type RenderOptions
- type SearchFilter
- func (f *SearchFilter) AddMatch(index int)
- func (f *SearchFilter) Clear()
- func (f *SearchFilter) ClearMatches()
- func (f *SearchFilter) IsActive() bool
- func (f *SearchFilter) MatchCount() int
- func (f *SearchFilter) SetSearched(searched bool)
- func (f *SearchFilter) ShouldShow(index int, metadata *motor.EntryMetadata) bool
- type SearchMode
- type Section
- type ViewMode
- type ViewportFocus
- type ViewportSearchState
- func (s *ViewportSearchState) Activate()
- func (s *ViewportSearchState) Clear()
- func (s *ViewportSearchState) Deactivate()
- func (s *ViewportSearchState) GetRenderedContent() string
- func (s *ViewportSearchState) HasJSONContent() bool
- func (s *ViewportSearchState) MoveCursor(direction int)
- func (s *ViewportSearchState) RenderSearchPanel(width int) string
- func (s *ViewportSearchState) SetContent(jsonContent string, width int) error
- func (s *ViewportSearchState) SetQueryWithoutSearch(query string)
- func (s *ViewportSearchState) ToggleFiltered()
- func (s *ViewportSearchState) ToggleKeySearchOnly()
- func (s *ViewportSearchState) UpdateQuery(query string)
Constants ¶
This section is empty.
Variables ¶
var ( RGBBlue = lipgloss.Color("45") RGBPink = lipgloss.Color("201") RGBRed = lipgloss.Color("196") RGBYellow = lipgloss.Color("220") RGBGreen = lipgloss.Color("46") RGBGrey = lipgloss.Color("246") RGBSubtlePink = lipgloss.Color("#2a1a2a") )
Color constants matching vacuum EXACTLY
var ( SyntaxKeyStyle = lipgloss.NewStyle().Foreground(RGBBlue).Bold(true) SyntaxNumberStyle = lipgloss.NewStyle().Foreground(RGBYellow).Bold(true) SyntaxDashStyle = lipgloss.NewStyle().Foreground(RGBPink) )
Syntax highlighting styles for JSON/YAML
var ( TitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(RGBPink) SubtitleStyle = lipgloss.NewStyle(). Foreground(RGBGrey) HeaderStyle = lipgloss.NewStyle(). Bold(true). Foreground(RGBBlue) SelectedStyle = lipgloss.NewStyle(). Background(RGBSubtlePink). Foreground(RGBPink) StatusOKStyle = lipgloss.NewStyle(). Foreground(RGBGreen) StatusWarningStyle = lipgloss.NewStyle(). Foreground(RGBYellow) StatusErrorStyle = lipgloss.NewStyle(). Foreground(RGBRed) BorderStyle = lipgloss.NewStyle(). BorderStyle(lipgloss.NormalBorder()). BorderForeground(RGBBlue) ViewportTitleStyle = lipgloss.NewStyle(). Bold(true). Foreground(RGBBlue). Background(RGBGrey). Padding(0, 1) HelpStyle = lipgloss.NewStyle(). Foreground(RGBGrey) HelpKeyStyle = lipgloss.NewStyle(). Foreground(RGBPink) ErrorStyle = lipgloss.NewStyle(). Foreground(RGBRed). Bold(true) )
General styles
var ( // HTTP Methods StyleMethodGreen = lipgloss.NewStyle().Foreground(RGBGreen) // GET, QUERY StyleMethodYellow = lipgloss.NewStyle().Foreground(RGBYellow) // PATCH StyleMethodBlue = lipgloss.NewStyle().Foreground(RGBBlue) // PUT, POST StyleMethodRed = lipgloss.NewStyle().Foreground(RGBRed) // DELETE // Status codes StyleStatus4xx = lipgloss.NewStyle().Foreground(RGBYellow) // 4xx errors StyleStatus5xx = lipgloss.NewStyle().Foreground(RGBRed) // 5xx errors // Duration (faint like entry count) StyleDurationFaint = lipgloss.NewStyle().Faint(true) )
Table colorization styles for methods and status codes
Functions ¶
func ApplySyntaxHighlightingToLine ¶
ApplySyntaxHighlightingToLine applies syntax highlighting to a single line
func ApplyTableStyles ¶
ApplyTableStyles applies the Vacuum table theme to match exactly
func ColorizeHARTableOutput ¶
colorizes table output following vacuum pattern - skips selected row to preserve background
func HighlightJSONLine ¶
HighlightJSONLine handles JSON syntax highlighting
func HighlightYAMLKeyValue ¶
HighlightYAMLKeyValue handles key-value pair highlighting for YAML
Types ¶
type EntryFilter ¶
type EntryFilter interface {
ShouldShow(index int, metadata *motor.EntryMetadata) bool
IsActive() bool
}
EntryFilter defines a filter that can show/hide entries
type FileTypeFilter ¶
type FileTypeFilter struct {
// contains filtered or unexported fields
}
FileTypeFilter filters entries based on file extensions
func NewFileTypeFilter ¶
func NewFileTypeFilter() *FileTypeFilter
NewFileTypeFilter creates a new file type filter
func (*FileTypeFilter) ExcludeCategory ¶
func (f *FileTypeFilter) ExcludeCategory(category string)
ExcludeCategory adds a category to the exclusion list
func (*FileTypeFilter) IncludeCategory ¶
func (f *FileTypeFilter) IncludeCategory(category string)
IncludeCategory removes a category from the exclusion list
func (*FileTypeFilter) IsActive ¶
func (f *FileTypeFilter) IsActive() bool
IsActive returns true if any categories are excluded
func (*FileTypeFilter) ShouldShow ¶
func (f *FileTypeFilter) ShouldShow(index int, metadata *motor.EntryMetadata) bool
ShouldShow returns true if the entry URL is not an excluded file type
func (*FileTypeFilter) ToggleCategory ¶
func (f *FileTypeFilter) ToggleCategory(category string, include bool)
ToggleCategory toggles a category's exclusion state
type FilterChain ¶
type FilterChain struct {
// contains filtered or unexported fields
}
FilterChain combines multiple filters
func (*FilterChain) Add ¶
func (fc *FilterChain) Add(filter EntryFilter)
Add adds a filter to the chain
func (*FilterChain) BuildFilteredRows ¶
func (fc *FilterChain) BuildFilteredRows(allEntries []*motor.EntryMetadata, allRows []table.Row) ([]table.Row, []int)
BuildFilteredRows applies all active filters to build a filtered row set Returns both the filtered rows and a mapping from filtered index to original index
func (*FilterChain) HasActiveFilters ¶
func (fc *FilterChain) HasActiveFilters() bool
HasActiveFilters returns true if any filters are active
type HARViewModel ¶
type HARViewModel struct {
// contains filtered or unexported fields
}
func NewHARViewModel ¶
func NewHARViewModel(fileName string) (*HARViewModel, error)
func (*HARViewModel) Cleanup ¶
func (m *HARViewModel) Cleanup() error
Cleanup releases resources when the model is destroyed
func (*HARViewModel) Init ¶
func (m *HARViewModel) Init() tea.Cmd
func (*HARViewModel) View ¶
func (m *HARViewModel) View() string
type JSONMatch ¶
type JSONMatch struct {
Path string // Full path to the match (e.g., "user.address.city")
Key string // The actual key name
Value interface{} // The value at this path
LineStart int // Starting line number in rendered output
LineEnd int // Ending line number in rendered output
IsKey bool // True if this match is a key match
ParentPath string // Path to the parent object/array
}
JSONMatch represents a match found in JSON content
type JSONRenderer ¶
type JSONRenderer struct {
// contains filtered or unexported fields
}
JSONRenderer handles rendering JSON with search highlighting and filtering
func NewJSONRenderer ¶
func NewJSONRenderer(jsonContent string, width int) (*JSONRenderer, error)
NewJSONRenderer creates a new JSON renderer
func (*JSONRenderer) GetMatchCount ¶
func (r *JSONRenderer) GetMatchCount() int
GetMatchCount returns the number of matches
func (*JSONRenderer) HasMatches ¶
func (r *JSONRenderer) HasMatches() bool
HasMatches returns true if there are search matches
func (*JSONRenderer) IsFiltered ¶
func (r *JSONRenderer) IsFiltered() bool
IsFiltered returns the current filter state
func (*JSONRenderer) Render ¶
func (r *JSONRenderer) Render() string
Render renders the JSON with highlighting and optional filtering
func (*JSONRenderer) SetSearch ¶
func (r *JSONRenderer) SetSearch(query string, keysOnly bool)
SetSearch updates the search query
func (*JSONRenderer) ToggleFiltered ¶
func (r *JSONRenderer) ToggleFiltered()
ToggleFiltered toggles between filtered and full view
type JSONSearchEngine ¶
type JSONSearchEngine struct {
// contains filtered or unexported fields
}
JSONSearchEngine handles searching within JSON content
func NewJSONSearchEngine ¶
func NewJSONSearchEngine(jsonContent string) (*JSONSearchEngine, error)
NewJSONSearchEngine creates a new JSON search engine
func (*JSONSearchEngine) FilterJSON ¶
func (e *JSONSearchEngine) FilterJSON(includeParents bool) (interface{}, error)
FilterJSON returns a filtered version of the JSON containing only matched paths
func (*JSONSearchEngine) GetMatchedPaths ¶
func (e *JSONSearchEngine) GetMatchedPaths() []string
GetMatchedPaths returns all paths that have matches
func (*JSONSearchEngine) IsParentPath ¶
func (e *JSONSearchEngine) IsParentPath(path string) bool
IsParentPath checks if a path is a parent of any matched path
func (*JSONSearchEngine) IsPathMatched ¶
func (e *JSONSearchEngine) IsPathMatched(path string) bool
IsPathMatched checks if a specific path has a match
type KeyValuePair ¶
KeyValuePair represents a single key-value pair
type RenderOptions ¶
type RenderOptions struct {
Width int // total available width
Truncate bool // whether to truncate long values
KeyWidth int // key column width (0 = auto-calculate)
}
RenderOptions configures key-value rendering
type SearchFilter ¶
type SearchFilter struct {
// contains filtered or unexported fields
}
SearchFilter filters entries based on search results
func NewSearchFilter ¶
func NewSearchFilter() *SearchFilter
NewSearchFilter creates a new search filter
func (*SearchFilter) AddMatch ¶
func (f *SearchFilter) AddMatch(index int)
AddMatch adds an entry index to the match set
func (*SearchFilter) Clear ¶
func (f *SearchFilter) Clear()
Clear removes all matches and marks filter as inactive
func (*SearchFilter) ClearMatches ¶
func (f *SearchFilter) ClearMatches()
ClearMatches removes all matches but keeps the filter active if it was searched
func (*SearchFilter) IsActive ¶
func (f *SearchFilter) IsActive() bool
IsActive returns true if a search has been executed
func (*SearchFilter) MatchCount ¶
func (f *SearchFilter) MatchCount() int
MatchCount returns the number of matches
func (*SearchFilter) SetSearched ¶
func (f *SearchFilter) SetSearched(searched bool)
SetSearched marks the filter as having executed a search
func (*SearchFilter) ShouldShow ¶
func (f *SearchFilter) ShouldShow(index int, metadata *motor.EntryMetadata) bool
ShouldShow returns true if the entry index is in the match set
type SearchMode ¶
type SearchMode int
SearchMode defines how to search JSON content
const ( SearchKeysOnly SearchMode = iota SearchKeysAndValues )
type Section ¶
type Section struct {
Title string
Pairs []KeyValuePair
}
Section represents a grouped section of key-value pairs
type ViewportFocus ¶
type ViewportFocus int
ViewportFocus represents which viewport has focus
const ( ViewportFocusRequest ViewportFocus = iota ViewportFocusResponse )
type ViewportSearchState ¶
type ViewportSearchState struct {
// contains filtered or unexported fields
}
ViewportSearchState tracks search state for a single viewport
func NewViewportSearchState ¶
func NewViewportSearchState() *ViewportSearchState
NewViewportSearchState creates a new viewport search state
func (*ViewportSearchState) Activate ¶
func (s *ViewportSearchState) Activate()
Activate activates the search UI
func (*ViewportSearchState) Clear ¶
func (s *ViewportSearchState) Clear()
Clear clears the search state
func (*ViewportSearchState) Deactivate ¶
func (s *ViewportSearchState) Deactivate()
Deactivate deactivates the search UI
func (*ViewportSearchState) GetRenderedContent ¶
func (s *ViewportSearchState) GetRenderedContent() string
GetRenderedContent returns the JSON content with search highlighting/filtering applied
func (*ViewportSearchState) HasJSONContent ¶
func (s *ViewportSearchState) HasJSONContent() bool
HasJSONContent returns true if valid JSON content is loaded
func (*ViewportSearchState) MoveCursor ¶
func (s *ViewportSearchState) MoveCursor(direction int)
MoveCursor moves the cursor between input and checkbox
func (*ViewportSearchState) RenderSearchPanel ¶
func (s *ViewportSearchState) RenderSearchPanel(width int) string
RenderSearchPanel renders the search panel for the viewport
func (*ViewportSearchState) SetContent ¶
func (s *ViewportSearchState) SetContent(jsonContent string, width int) error
SetContent updates the content being searched
func (*ViewportSearchState) SetQueryWithoutSearch ¶
func (s *ViewportSearchState) SetQueryWithoutSearch(query string)
SetQueryWithoutSearch just updates the query without searching
func (*ViewportSearchState) ToggleFiltered ¶
func (s *ViewportSearchState) ToggleFiltered()
ToggleFiltered toggles between filtered and full view
func (*ViewportSearchState) ToggleKeySearchOnly ¶
func (s *ViewportSearchState) ToggleKeySearchOnly()
ToggleKeySearchOnly toggles the key search mode
func (*ViewportSearchState) UpdateQuery ¶
func (s *ViewportSearchState) UpdateQuery(query string)
UpdateQuery updates the search query and performs the search