Documentation
¶
Index ¶
- func HorizontalLoader(width int, frame int, message string) string
- func MatchesQuery(text, query string) bool
- type Dialog
- func (d *Dialog) Hide()
- func (d *Dialog) IsVisible() bool
- func (d *Dialog) ShowConfirm(title, message, action string, ctx interface{})
- func (d *Dialog) ShowEditRequest(node *TreeNode)
- func (d *Dialog) ShowInput(title, message, defaultValue, action string, ctx interface{})
- func (d *Dialog) ShowKeyValue(title, defaultKey, defaultValue, action string, ctx interface{})
- func (d *Dialog) ShowNewRequest(action string, node *TreeNode)
- func (d *Dialog) Update(msg tea.Msg) (*Dialog, tea.Cmd)
- func (d *Dialog) View(screenWidth, screenHeight int) string
- type DialogResultMsg
- type DialogType
- type Editor
- func (e *Editor) CanRedo() bool
- func (e *Editor) CanUndo() bool
- func (e *Editor) EnableExternalEditor(enabled bool)
- func (e *Editor) FormatJSON() tea.Cmd
- func (e *Editor) GetContent() string
- func (e *Editor) GetCursorPosition() (row, col int)
- func (e *Editor) GetExternalEditorField() api.EditableField
- func (e *Editor) GetMatchCount() (int, int)
- func (e *Editor) GetMode() EditorMode
- func (e *Editor) GetPreviewContent() string
- func (e *Editor) HasSearchQuery() bool
- func (e *Editor) IsExternalEditorEnabled() bool
- func (e *Editor) IsPreviewMode() bool
- func (e *Editor) IsSearching() bool
- func (e *Editor) SetContent(content string)
- func (e *Editor) SetCursorPosition(row, col int)
- func (e *Editor) SetExternalEditorField(field api.EditableField)
- func (e *Editor) SetHeight(h int)
- func (e *Editor) SetReadOnly(readOnly bool)
- func (e *Editor) SetVariableValues(values map[string]string)
- func (e *Editor) TogglePreviewMode()
- func (e *Editor) Update(msg tea.Msg, allowInput bool) (*Editor, tea.Cmd)
- func (e *Editor) View(width, height int, active bool) string
- type EditorContentChangedMsg
- type EditorErrorType
- type EditorFormatMsg
- type EditorMode
- type EditorQuitMsg
- type EditorState
- type ExternalEditorErrorMsg
- type ExternalEditorFinishedMsg
- type ExternalEditorRequestMsg
- type FormField
- type KeyBinding
- type KeyContext
- type KeyGroup
- type KeyValuePair
- type Loader
- type LoaderStyle
- type LoaderTickMsg
- type Modal
- type ModalCloseMsg
- type ModalResult
- type ModalType
- type NodeType
- type SearchCloseMsg
- type SearchInput
- func (s *SearchInput) Clear()
- func (s *SearchInput) GetQuery() string
- func (s *SearchInput) Hide()
- func (s *SearchInput) IsVisible() bool
- func (s *SearchInput) Show()
- func (s *SearchInput) Update(msg tea.Msg) (*SearchInput, tea.Cmd)
- func (s *SearchInput) View(width int) string
- func (s *SearchInput) ViewBox(width int) string
- func (s *SearchInput) ViewCompact(width int, matchCount int, totalCount int) string
- type SearchMatch
- type SearchUpdateMsg
- type Tab
- type TabItem
- type Table
- func (t *Table) AddRow(key, value string)
- func (t *Table) AddRowWithState(key, value string, enabled bool)
- func (t *Table) DeleteRow(index int)
- func (t *Table) FromMap(data map[string]string)
- func (t *Table) GetRows() [][]string
- func (t *Table) GetSelectedIndex() int
- func (t *Table) MoveDown()
- func (t *Table) MoveUp()
- func (t *Table) RowCount() int
- func (t *Table) ToMap() map[string]string
- func (t *Table) ToggleCurrentEnabled()
- func (t *Table) ToggleEdit()
- func (t *Table) ToggleEnabled(index int)
- func (t *Table) View(width, height int) string
- func (t *Table) ViewSimple() string
- type Tabs
- func (t *Tabs) GetActive() string
- func (t *Tabs) Next()
- func (t *Tabs) Previous()
- func (t *Tabs) SetActive(index int)
- func (t *Tabs) View(width int) string
- func (t *Tabs) ViewCompact(width int) string
- func (t *Tabs) ViewSimple() string
- func (t *Tabs) ViewWithBorder(width int) string
- func (t *Tabs) ViewWithShortcuts(width int) string
- type Tree
- func (t *Tree) Collapse() bool
- func (t *Tree) Down()
- func (t *Tree) Expand() bool
- func (t *Tree) FindNodeByID(id string) *TreeNode
- func (t *Tree) GetExpandedFolders() []string
- func (t *Tree) GetHeight() int
- func (t *Tree) GetScrollOffset() int
- func (t *Tree) GetScrollPosition() int
- func (t *Tree) GetSelectedIndex() int
- func (t *Tree) GetVisibleItems() []*TreeNode
- func (t *Tree) GoToFirst()
- func (t *Tree) GoToLast()
- func (t *Tree) HasSearchQuery() bool
- func (t *Tree) IsSearching() bool
- func (t *Tree) Refresh()
- func (t *Tree) RestoreState(state *TreeState)
- func (t *Tree) SaveState() *TreeState
- func (t *Tree) SelectIndex(index int)
- func (t *Tree) Selected() *TreeNode
- func (t *Tree) SetExpandedFolders(folderIDs []string)
- func (t *Tree) SetHeight(h int)
- func (t *Tree) SetScrollPosition(offset int)
- func (t *Tree) SetSelectedIndex(index int)
- func (t *Tree) Up()
- func (t *Tree) Update(msg tea.Msg, allowNavigation bool) (*Tree, tea.Cmd)
- func (t *Tree) View(width, height int, active bool) string
- func (t *Tree) VisibleRange() (start, end int)
- type TreeActionMsg
- type TreeDeleteMsg
- type TreeDuplicateMsg
- type TreeEditRequestMsg
- type TreeExpandMsg
- type TreeNewFolderMsg
- type TreeNewRequestMsg
- type TreeNode
- type TreePasteMsg
- type TreeRenameMsg
- type TreeSelectionMsg
- type TreeState
- type TreeYankMsg
- type WhichKey
- func (w *WhichKey) GetContext() KeyContext
- func (w *WhichKey) GetHintsForStatusBar(ctx KeyContext) string
- func (w *WhichKey) Hide()
- func (w *WhichKey) IsVisible() bool
- func (w *WhichKey) SetContext(ctx KeyContext)
- func (w *WhichKey) Show()
- func (w *WhichKey) Toggle()
- func (w *WhichKey) Update(msg tea.Msg) (*WhichKey, tea.Cmd)
- func (w *WhichKey) View(screenWidth, screenHeight int) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HorizontalLoader ¶
HorizontalLoader creates a simple horizontal loading bar for inline use
func MatchesQuery ¶
MatchesQuery checks if a string matches the search query (case-insensitive)
Types ¶
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog represents a modal dialog component
func (*Dialog) ShowConfirm ¶
ShowConfirm shows a confirmation dialog
func (*Dialog) ShowEditRequest ¶
ShowEditRequest shows an edit request dialog with existing values
func (*Dialog) ShowKeyValue ¶
ShowKeyValue shows a key-value input dialog
func (*Dialog) ShowNewRequest ¶
ShowNewRequest shows a new request dialog with method selector and URL
type DialogResultMsg ¶
type DialogResultMsg struct {
Action string
Confirmed bool
Value string
Method string // HTTP method for new request
URL string // URL endpoint for new request / Value for key-value dialogs
Node *TreeNode
Context interface{} // Generic context for callbacks
}
DialogResultMsg is sent when a dialog is completed
type DialogType ¶
type DialogType int
DialogType represents the type of dialog
const ( DialogInput DialogType = iota DialogConfirm DialogNewRequest DialogEditRequest DialogKeyValue // For key-value input (Request panel) )
type Editor ¶
type Editor struct {
// contains filtered or unexported fields
}
Editor is a vim-like text editor component with line numbers
func (*Editor) EnableExternalEditor ¶ added in v1.2.0
EnableExternalEditor enables external editor support for this editor
func (*Editor) FormatJSON ¶
FormatJSON formats the content as JSON with proper indentation
func (*Editor) GetContent ¶
GetContent returns the editor content as a single string
func (*Editor) GetCursorPosition ¶
GetCursorPosition returns the current cursor row and column
func (*Editor) GetExternalEditorField ¶ added in v1.2.0
func (e *Editor) GetExternalEditorField() api.EditableField
GetExternalEditorField returns the field type for external editing
func (*Editor) GetMatchCount ¶
GetMatchCount returns (currentMatch, totalMatches)
func (*Editor) GetMode ¶
func (e *Editor) GetMode() EditorMode
GetMode returns the current editor mode
func (*Editor) GetPreviewContent ¶
GetPreviewContent returns content with variables replaced (for preview) System variables ($timestamp, $uuid, etc.) are always resolved in preview mode, even when no environment variables are set
func (*Editor) HasSearchQuery ¶
HasSearchQuery returns true if there's an active search query
func (*Editor) IsExternalEditorEnabled ¶ added in v1.2.0
IsExternalEditorEnabled returns whether external editor is enabled
func (*Editor) IsPreviewMode ¶
IsPreviewMode returns true if preview mode is active
func (*Editor) IsSearching ¶
IsSearching returns true if search input is visible
func (*Editor) SetContent ¶
SetContent sets the editor content
func (*Editor) SetCursorPosition ¶
SetCursorPosition sets the cursor to the specified row and column
func (*Editor) SetExternalEditorField ¶ added in v1.2.0
func (e *Editor) SetExternalEditorField(field api.EditableField)
SetExternalEditorField sets which field this editor represents for external editing
func (*Editor) SetReadOnly ¶
SetReadOnly sets whether the editor is read-only
func (*Editor) SetVariableValues ¶
SetVariableValues sets the variable values for preview mode
func (*Editor) TogglePreviewMode ¶
func (e *Editor) TogglePreviewMode()
TogglePreviewMode toggles the preview mode on/off
type EditorContentChangedMsg ¶
type EditorContentChangedMsg struct {
Content string
}
EditorContentChangedMsg is sent when editor content is modified
type EditorErrorType ¶ added in v1.2.0
type EditorErrorType string
EditorErrorType categorizes editor errors
const ( EditorErrorNoEditor EditorErrorType = "no_editor" EditorErrorNotFound EditorErrorType = "not_found" EditorErrorTempFile EditorErrorType = "temp_file" EditorErrorProcess EditorErrorType = "process" EditorErrorReadContent EditorErrorType = "read_content" )
type EditorFormatMsg ¶
EditorFormatMsg is sent when JSON is formatted
type EditorMode ¶
type EditorMode int
EditorMode represents the current editing mode
const ( EditorNormalMode EditorMode = iota EditorInsertMode )
type EditorQuitMsg ¶
type EditorQuitMsg struct{}
EditorQuitMsg is sent when user presses Q in NORMAL mode to quit the app
type EditorState ¶
type EditorState struct {
// contains filtered or unexported fields
}
EditorState represents a snapshot of editor state for undo/redo
type ExternalEditorErrorMsg ¶ added in v1.2.0
type ExternalEditorErrorMsg struct {
// Field that was being edited
Field api.EditableField
// Err describes what went wrong
Err error
// ErrorType categorizes the error
ErrorType EditorErrorType
}
ExternalEditorErrorMsg indicates editor could not be opened
type ExternalEditorFinishedMsg ¶ added in v1.2.0
type ExternalEditorFinishedMsg struct {
// Field that was edited
Field api.EditableField
// Content is the new content (if successful)
Content string
// OriginalContent for comparison
OriginalContent string
// Changed indicates if content was modified
Changed bool
// Err is non-nil if an error occurred
Err error
// Duration is how long the editor was open
Duration time.Duration
}
ExternalEditorFinishedMsg indicates editor has closed
type ExternalEditorRequestMsg ¶ added in v1.2.0
type ExternalEditorRequestMsg struct {
// Field to edit (body or headers)
Field api.EditableField
// Content is the current content to edit
Content string
// ContentType is the detected or specified content type
ContentType api.ContentType
}
ExternalEditorRequestMsg requests opening an external editor
type FormField ¶
type FormField struct {
Name string
Label string
Value string
Type string // "text", "checkbox", "radio"
Options []string // For radio buttons
Placeholder string
CursorPos int // Cursor position for text fields
}
FormField represents a field in a form modal
type KeyBinding ¶
KeyBinding represents a single keybinding with its description
type KeyContext ¶
type KeyContext string
KeyContext represents a context with its keybindings
const ( ContextGlobal KeyContext = "global" ContextNormalCollections KeyContext = "normal_collections" ContextNormalEnv KeyContext = "normal_env" ContextNormalRequest KeyContext = "normal_request" ContextNormalResponse KeyContext = "normal_response" ContextSearchCollections KeyContext = "search_collections" ContextSearchEnv KeyContext = "search_env" ContextInsert KeyContext = "insert" ContextView KeyContext = "view" ContextCommand KeyContext = "command" ContextDialog KeyContext = "dialog" ContextModal KeyContext = "modal" // Request panel tab contexts ContextRequestParams KeyContext = "request_params" ContextRequestAuth KeyContext = "request_auth" ContextRequestHeaders KeyContext = "request_headers" ContextRequestBody KeyContext = "request_body" ContextRequestScripts KeyContext = "request_scripts" // Response panel tab contexts ContextConsole KeyContext = "console" // Jump mode context ContextJump KeyContext = "jump" )
type KeyGroup ¶
type KeyGroup struct {
Name string
Bindings []KeyBinding
}
KeyGroup represents a group of related keybindings
type KeyValuePair ¶
KeyValuePair represents a key-value pair with enabled state
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader is an animated loading indicator component
func NewLoader ¶
func NewLoader(style LoaderStyle, message string) *Loader
NewLoader creates a new loader component
func (*Loader) SetMessage ¶
SetMessage updates the loader message
type LoaderStyle ¶
type LoaderStyle int
LoaderStyle represents different loader animation styles
const ( LoaderSpinner LoaderStyle = iota LoaderDots LoaderBar LoaderPulse )
type Modal ¶
type Modal struct {
Title string
Message string
Type ModalType
Tag string // Identifier for this modal
Visible bool
Fields []FormField
FocusIndex int
ConfirmText string
CancelText string
Width int
Height int
}
Modal represents a modal dialog
func NewConfirmModal ¶
NewConfirmModal creates a confirmation modal
func NewFormModal ¶
NewFormModal creates a form modal with multiple fields
func NewInputModal ¶
NewInputModal creates a single input modal
func (*Modal) GetFieldValue ¶
GetFieldValue gets a field value by name
func (*Modal) SetFieldValue ¶
SetFieldValue sets a field value by name
type ModalCloseMsg ¶
type ModalCloseMsg struct {
Result ModalResult
Tag string // Identifier for which modal closed
}
ModalCloseMsg is sent when a modal is closed
type ModalResult ¶
ModalResult represents the result of a modal action
type SearchCloseMsg ¶
type SearchCloseMsg struct {
Canceled bool
}
SearchCloseMsg is sent when search is closed
type SearchInput ¶
type SearchInput struct {
// contains filtered or unexported fields
}
SearchInput represents a search input field
func (*SearchInput) GetQuery ¶
func (s *SearchInput) GetQuery() string
GetQuery returns current search query
func (*SearchInput) IsVisible ¶
func (s *SearchInput) IsVisible() bool
IsVisible returns visibility state
func (*SearchInput) Update ¶
func (s *SearchInput) Update(msg tea.Msg) (*SearchInput, tea.Cmd)
Update handles input messages
func (*SearchInput) View ¶
func (s *SearchInput) View(width int) string
View renders the search input inline (for panel header)
func (*SearchInput) ViewBox ¶
func (s *SearchInput) ViewBox(width int) string
ViewBox renders the search as a box at the top of content (legacy - use ViewCompact instead)
func (*SearchInput) ViewCompact ¶
func (s *SearchInput) ViewCompact(width int, matchCount int, totalCount int) string
ViewCompact renders a compact inline search bar with match count (no border)
type SearchMatch ¶
type SearchMatch struct {
Row int // Line number (0-indexed)
ColStart int // Start column
ColEnd int // End column (exclusive)
}
SearchMatch represents a match position in the editor
type SearchUpdateMsg ¶
type SearchUpdateMsg struct {
Query string
}
SearchUpdateMsg is sent when search query changes
type Table ¶
type Table struct {
Headers []string
Rows []KeyValuePair
Cursor int
Editing bool
EditCol int // 0 for key, 1 for value
}
Table represents an editable table component
func (*Table) AddRowWithState ¶
AddRowWithState adds a new row with specific enabled state
func (*Table) GetSelectedIndex ¶
GetSelectedIndex returns the current cursor position
func (*Table) ToggleCurrentEnabled ¶
func (t *Table) ToggleCurrentEnabled()
ToggleCurrentEnabled toggles the enabled state of the current row
func (*Table) ToggleEnabled ¶
ToggleEnabled toggles the enabled state of a row
func (*Table) ViewSimple ¶
ViewSimple renders a simple table view
type Tabs ¶
type Tabs struct {
Items []string
Shortcuts []string // Keyboard shortcuts for each tab
ActiveIndex int
}
Tabs represents a tab bar component
func NewTabsWithShortcuts ¶
NewTabsWithShortcuts creates a new tabs component with keyboard shortcuts
func (*Tabs) ViewCompact ¶
ViewCompact renders tabs in a compact format with shortcuts
func (*Tabs) ViewSimple ¶
ViewSimple renders tabs without styling (for mockup)
func (*Tabs) ViewWithBorder ¶
ViewWithBorder renders the tabs with a border
func (*Tabs) ViewWithShortcuts ¶
ViewWithShortcuts renders tabs with keyboard shortcuts displayed
type Tree ¶
type Tree struct {
Root []*TreeNode // Top-level nodes
// contains filtered or unexported fields
}
Tree is the main tree view component
func NewTree ¶
func NewTree(collections []*api.CollectionFile) *Tree
NewTree creates a new tree from collections
func (*Tree) FindNodeByID ¶
FindNodeByID searches the tree recursively for a node with the given ID
func (*Tree) GetExpandedFolders ¶
GetExpandedFolders returns a list of expanded folder names/IDs for session persistence
func (*Tree) GetHeight ¶ added in v1.1.0
GetHeight returns the visible height of the tree (number of visible rows).
func (*Tree) GetScrollOffset ¶ added in v1.1.0
GetScrollOffset returns the current scroll offset.
func (*Tree) GetScrollPosition ¶
GetScrollPosition returns the current scroll offset for session persistence
func (*Tree) GetSelectedIndex ¶
GetSelectedIndex returns the current cursor position for session persistence
func (*Tree) GetVisibleItems ¶ added in v1.1.0
GetVisibleItems returns a copy of the currently visible tree nodes. Useful for jump mode to enumerate targets. Returns a copy to prevent external mutation of internal state.
func (*Tree) HasSearchQuery ¶
HasSearchQuery returns true if there's an active search query (not input visible)
func (*Tree) IsSearching ¶
IsSearching returns true if search is active
func (*Tree) RestoreState ¶
RestoreState restores the tree state after reload
func (*Tree) SelectIndex ¶ added in v1.1.0
SelectIndex selects an item by its visual index in the visible items. This is used by jump mode to navigate directly to a target.
func (*Tree) SetExpandedFolders ¶
SetExpandedFolders expands folders matching the given IDs
func (*Tree) SetScrollPosition ¶
SetScrollPosition sets the scroll offset from session state
func (*Tree) SetSelectedIndex ¶
SetSelectedIndex sets the cursor position from session state
func (*Tree) VisibleRange ¶
VisibleRange returns the range of visible nodes
type TreeActionMsg ¶
type TreeActionMsg struct {
Action string // "rename", "delete", "yank", "paste", "new_request", "new_folder", "duplicate"
Node *TreeNode // Target node
}
TreeActionMsg is sent for tree manipulation actions
type TreeDeleteMsg ¶
type TreeDeleteMsg struct {
Node *TreeNode
}
TreeDeleteMsg is sent when delete is requested
type TreeDuplicateMsg ¶
type TreeDuplicateMsg struct {
Node *TreeNode
}
TreeDuplicateMsg is sent to duplicate a node
type TreeEditRequestMsg ¶
type TreeEditRequestMsg struct {
Node *TreeNode
}
TreeEditRequestMsg is sent to edit a request
type TreeExpandMsg ¶
TreeExpandMsg is sent when a folder is expanded/collapsed
type TreeNewFolderMsg ¶
type TreeNewFolderMsg struct {
ParentNode *TreeNode // nil for root level
}
TreeNewFolderMsg is sent to create a new folder
type TreeNewRequestMsg ¶
type TreeNewRequestMsg struct {
ParentNode *TreeNode // nil for root level
}
TreeNewRequestMsg is sent to create a new request
type TreeNode ¶
type TreeNode struct {
ID string // Unique identifier
Name string // Display name
Type NodeType // Node type
Children []*TreeNode // Child nodes (empty for requests)
Expanded bool // Whether folder is expanded
HTTPMethod string // HTTP method (only for RequestNode)
URL string // Request URL (only for RequestNode)
Depth int // Nesting level (0 = root)
Parent *TreeNode // Reference to parent node
}
TreeNode represents a single node in the tree
type TreePasteMsg ¶
type TreePasteMsg struct {
TargetNode *TreeNode // Where to paste
}
TreePasteMsg is sent when paste is requested
type TreeRenameMsg ¶
type TreeRenameMsg struct {
Node *TreeNode
}
TreeRenameMsg is sent when renaming is initiated
type TreeSelectionMsg ¶
type TreeSelectionMsg struct {
Node *TreeNode
}
TreeSelectionMsg is sent when a request is selected
type TreeState ¶
type TreeState struct {
ExpandedNodes map[string]bool // Map of node IDs to expanded state
SelectedID string // ID of selected node
CursorPos int // Cursor position
ScrollOffset int // Scroll offset
}
TreeState stores the state of the tree for restoration
type TreeYankMsg ¶
type TreeYankMsg struct {
Node *TreeNode
}
TreeYankMsg is sent when a node is yanked (copied)
type WhichKey ¶
type WhichKey struct {
// contains filtered or unexported fields
}
WhichKey manages keybinding hints display
func (*WhichKey) GetContext ¶
func (w *WhichKey) GetContext() KeyContext
GetContext returns the current context
func (*WhichKey) GetHintsForStatusBar ¶
func (w *WhichKey) GetHintsForStatusBar(ctx KeyContext) string
GetHintsForStatusBar returns a compact hint string for the statusbar
func (*WhichKey) SetContext ¶
func (w *WhichKey) SetContext(ctx KeyContext)
SetContext sets the current context