Documentation
¶
Index ¶
- func NewBodyTextArea() textarea.Model
- func NewConfiguredTextInput(config TextInputConfig) textinput.Model
- func NewHeadersTextArea() textarea.Model
- func NewLoadTestInput(placeholder string, charLimit, width int) textinput.Model
- func NewNameInput() textinput.Model
- func NewURLInput(db *storage.SQLiteStorage) textinput.Model
- type FieldIndex
- type LoadTestMode
- func (ltm *LoadTestMode) GetFocusManager(m *RequestPane) *ui.FocusManager
- func (ltm *LoadTestMode) GetFocusManagerWithIndex(m *RequestPane, index int) *ui.FocusManager
- func (ltm *LoadTestMode) HandleInput(m *RequestPane, msg tea.KeyMsg) (tea.Model, tea.Cmd)
- func (ltm *LoadTestMode) OnEnter(m *RequestPane)
- func (ltm *LoadTestMode) OnExit(m *RequestPane)
- type ModeStrategy
- type NormalMode
- func (nm *NormalMode) GetFocusManager(m *RequestPane) *ui.FocusManager
- func (nm *NormalMode) GetFocusManagerWithIndex(m *RequestPane, index int) *ui.FocusManager
- func (nm *NormalMode) HandleInput(m *RequestPane, msg tea.KeyMsg) (tea.Model, tea.Cmd)
- func (nm *NormalMode) OnEnter(m *RequestPane)
- func (nm *NormalMode) OnExit(m *RequestPane)
- type RequestPane
- func (m *RequestPane) ExitLoadTestMode()
- func (m *RequestPane) GetCurrentMethod() string
- func (m RequestPane) Init() tea.Cmd
- func (m *RequestPane) ResultMsgCleanup()
- func (m *RequestPane) SetFocused(focused bool)
- func (m *RequestPane) SetHeight(height int)
- func (m RequestPane) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m RequestPane) View() string
- type TextInputConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBodyTextArea ¶
NewBodyTextArea creates a pre-configured body textarea
func NewConfiguredTextInput ¶
func NewConfiguredTextInput(config TextInputConfig) textinput.Model
NewConfiguredTextInput creates a textinput.Model with the given configuration
func NewHeadersTextArea ¶
NewHeadersTextArea creates a pre-configured headers textarea
func NewLoadTestInput ¶
NewLoadTestInput creates a pre-configured load test input field
func NewNameInput ¶
NewNameInput creates a pre-configured name input field
func NewURLInput ¶
func NewURLInput(db *storage.SQLiteStorage) textinput.Model
NewURLInput creates a pre-configured URL input field
Types ¶
type FieldIndex ¶
type FieldIndex int
FieldIndex represents the index of a focusable field in the request pane
const ( FieldMethodSelector FieldIndex = iota FieldURL FieldName FieldHeaders FieldBody FieldSubmitButton )
const ( FieldLTConcurrency FieldIndex = iota + 5 FieldLTTotalReqs FieldLTQPS FieldLTTimeout FieldLTSubmit )
Load test mode field indices (extend from base fields)
type LoadTestMode ¶
type LoadTestMode struct{}
LoadTestMode implements the load test mode
func (*LoadTestMode) GetFocusManager ¶
func (ltm *LoadTestMode) GetFocusManager(m *RequestPane) *ui.FocusManager
GetFocusManager returns the focus manager for load test mode
func (*LoadTestMode) GetFocusManagerWithIndex ¶
func (ltm *LoadTestMode) GetFocusManagerWithIndex(m *RequestPane, index int) *ui.FocusManager
GetFocusManagerWithIndex returns the focus manager for load test mode starting at a specific index
func (*LoadTestMode) HandleInput ¶
func (ltm *LoadTestMode) HandleInput(m *RequestPane, msg tea.KeyMsg) (tea.Model, tea.Cmd)
HandleInput handles keyboard input in load test mode
func (*LoadTestMode) OnEnter ¶
func (ltm *LoadTestMode) OnEnter(m *RequestPane)
OnEnter is called when entering load test mode
func (*LoadTestMode) OnExit ¶
func (ltm *LoadTestMode) OnExit(m *RequestPane)
OnExit is called when exiting load test mode
type ModeStrategy ¶
type ModeStrategy interface {
// HandleInput handles keyboard input for this mode
HandleInput(m *RequestPane, msg tea.KeyMsg) (tea.Model, tea.Cmd)
// GetFocusManager returns the focus manager for this mode
GetFocusManager(m *RequestPane) *ui.FocusManager
// GetFocusManagerWithIndex returns the focus manager for this mode starting at a specific index
GetFocusManagerWithIndex(m *RequestPane, index int) *ui.FocusManager
// OnEnter is called when entering this mode
OnEnter(m *RequestPane)
// OnExit is called when exiting this mode
OnExit(m *RequestPane)
}
ModeStrategy defines the interface for different request pane modes (normal, load test, etc.)
type NormalMode ¶
type NormalMode struct{}
NormalMode implements the standard request mode
func (*NormalMode) GetFocusManager ¶
func (nm *NormalMode) GetFocusManager(m *RequestPane) *ui.FocusManager
GetFocusManager returns the focus manager for normal mode
func (*NormalMode) GetFocusManagerWithIndex ¶
func (nm *NormalMode) GetFocusManagerWithIndex(m *RequestPane, index int) *ui.FocusManager
GetFocusManagerWithIndex returns the focus manager for normal mode starting at a specific index
func (*NormalMode) HandleInput ¶
func (nm *NormalMode) HandleInput(m *RequestPane, msg tea.KeyMsg) (tea.Model, tea.Cmd)
HandleInput handles keyboard input in normal mode
func (*NormalMode) OnEnter ¶
func (nm *NormalMode) OnEnter(m *RequestPane)
OnEnter is called when entering normal mode
func (*NormalMode) OnExit ¶
func (nm *NormalMode) OnExit(m *RequestPane)
OnExit is called when exiting normal mode
type RequestPane ¶
type RequestPane struct {
Client *http.Client
Stopwatch stopwatch.Model
Quitting bool
PanelFocused bool
FocusManager *ui.FocusManager
MethodSelector *ui.MethodSelector
URLInput *textinput.Model
NameInput *textinput.Model
Headers *textarea.Model
Body *textarea.Model
SubmitButton *ui.SubmitButton
Request *http.Request
Height int
ParseErrors []string
HeadersExpanded bool
BodyExpanded bool
RequestInProgress bool
DB *storage.SQLiteStorage
// Load test mode fields
LoadTestMode bool
LoadTestConcurrency *textinput.Model
LoadTestTotalReqs *textinput.Model
LoadTestQPS *textinput.Model
LoadTestTimeout *textinput.Model
// contains filtered or unexported fields
}
RequestPane is the main component for handling HTTP request input
func SetupRequestPane ¶
func SetupRequestPane(db *storage.SQLiteStorage) RequestPane
SetupRequestPane creates and initializes a new RequestPane
func (*RequestPane) ExitLoadTestMode ¶
func (m *RequestPane) ExitLoadTestMode()
ExitLoadTestMode exits load test mode and resets state
func (*RequestPane) GetCurrentMethod ¶
func (m *RequestPane) GetCurrentMethod() string
GetCurrentMethod returns the currently selected HTTP method
func (*RequestPane) ResultMsgCleanup ¶
func (m *RequestPane) ResultMsgCleanup()
ResultMsgCleanup resets the stopwatch and request state after a response
func (*RequestPane) SetFocused ¶
func (m *RequestPane) SetFocused(focused bool)
SetFocused sets the panel focus state
func (*RequestPane) SetHeight ¶
func (m *RequestPane) SetHeight(height int)
SetHeight sets the height of the request pane