Documentation
¶
Overview ¶
Package models contains Bubble Tea models for the presentation layer.
Package models contains Bubble Tea models for the presentation layer.
Package models contains Bubble Tea models for the presentation layer.
Package models contains Bubble Tea models for the presentation layer.
Index ¶
- Constants
- type HistoryModel
- func (m *HistoryModel) GetEntries() []*repository.HistoryEntry
- func (m *HistoryModel) GetSelectedEntry() *repository.HistoryEntry
- func (m HistoryModel) Init() tea.Cmd
- func (m *HistoryModel) IsLoading() bool
- func (m HistoryModel) Update(msg tea.Msg) (HistoryModel, tea.Cmd)
- func (m HistoryModel) View() string
- type MainModel
- type RequestModel
- func (m *RequestModel) GetRequest() *domain.Request
- func (m RequestModel) Init() tea.Cmd
- func (m *RequestModel) IsLoading() bool
- func (m *RequestModel) LoadRequest(req *domain.Request)
- func (m RequestModel) NeedsArrowKeys() bool
- func (m RequestModel) RenderView() string
- func (m *RequestModel) SetError(err string)
- func (m RequestModel) Update(msg tea.Msg) (RequestModel, tea.Cmd)
- func (m RequestModel) View() string
- type ResponseModel
- func (m *ResponseModel) GetResponse() *domain.Response
- func (m *ResponseModel) HasResponse() bool
- func (m ResponseModel) Init() tea.Cmd
- func (m *ResponseModel) SetResponse(response *domain.Response)
- func (m ResponseModel) Update(msg tea.Msg) (ResponseModel, tea.Cmd)
- func (m ResponseModel) View() string
- type SaveDialogModel
Constants ¶
const ( TabRequest = iota TabResponse TabHistory )
Tab indices.
const (
// KeyCtrlC represents the Ctrl+C keyboard combination for quitting.
KeyCtrlC = "ctrl+c"
)
Key binding constants for keyboard shortcuts.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HistoryModel ¶
type HistoryModel struct {
// contains filtered or unexported fields
}
HistoryModel represents the history browser.
func NewHistoryModel ¶
func NewHistoryModel(historyService *app.HistoryService) HistoryModel
NewHistoryModel creates a new history browser model.
func (*HistoryModel) GetEntries ¶
func (m *HistoryModel) GetEntries() []*repository.HistoryEntry
GetEntries returns all history entries.
func (*HistoryModel) GetSelectedEntry ¶
func (m *HistoryModel) GetSelectedEntry() *repository.HistoryEntry
GetSelectedEntry returns the currently selected history entry.
func (HistoryModel) Init ¶
func (m HistoryModel) Init() tea.Cmd
Init initializes the model and loads history.
func (*HistoryModel) IsLoading ¶
func (m *HistoryModel) IsLoading() bool
IsLoading returns whether history is currently being loaded.
func (HistoryModel) Update ¶
func (m HistoryModel) Update(msg tea.Msg) (HistoryModel, tea.Cmd)
Update handles messages and updates the model.
type MainModel ¶
type MainModel struct {
// contains filtered or unexported fields
}
MainModel is the root model with tab navigation.
func NewMainModel ¶
func NewMainModel( requestService *app.RequestService, historyService *app.HistoryService, authService *app.AuthService, ) MainModel
NewMainModel creates a new main model with all sub-models.
func (MainModel) GetActiveTab ¶
GetActiveTab returns the currently active tab index.
func (*MainModel) SetStatusMessage ¶
SetStatusMessage sets the status bar message.
type RequestModel ¶
type RequestModel struct {
// contains filtered or unexported fields
}
RequestModel represents the request builder form.
func NewRequestModel ¶
func NewRequestModel(requestService *app.RequestService, authService *app.AuthService) RequestModel
NewRequestModel creates a new request builder model.
func (*RequestModel) GetRequest ¶
func (m *RequestModel) GetRequest() *domain.Request
GetRequest returns the current request being built.
func (*RequestModel) IsLoading ¶
func (m *RequestModel) IsLoading() bool
IsLoading returns whether a request is currently being sent.
func (*RequestModel) LoadRequest ¶
func (m *RequestModel) LoadRequest(req *domain.Request)
LoadRequest loads a request into the form fields.
func (RequestModel) NeedsArrowKeys ¶
func (m RequestModel) NeedsArrowKeys() bool
NeedsArrowKeys returns true if the current focused field is a text input that needs arrow keys for cursor movement (URL, Name, or Body fields). This prevents global arrow key handlers from hijacking cursor navigation.
func (RequestModel) RenderView ¶
func (m RequestModel) RenderView() string
RenderView renders the full request view with all components.
func (*RequestModel) SetError ¶
func (m *RequestModel) SetError(err string)
SetError sets an error message to display.
func (RequestModel) Update ¶
func (m RequestModel) Update(msg tea.Msg) (RequestModel, tea.Cmd)
Update handles messages and updates the model.
func (RequestModel) View ¶
func (m RequestModel) View() string
View renders the request builder form.
type ResponseModel ¶
type ResponseModel struct {
// contains filtered or unexported fields
}
ResponseModel represents the response viewer.
func NewResponseModel ¶
func NewResponseModel() ResponseModel
NewResponseModel creates a new response viewer model.
func (*ResponseModel) GetResponse ¶
func (m *ResponseModel) GetResponse() *domain.Response
GetResponse returns the current response.
func (*ResponseModel) HasResponse ¶
func (m *ResponseModel) HasResponse() bool
HasResponse returns whether a response is currently loaded.
func (*ResponseModel) SetResponse ¶
func (m *ResponseModel) SetResponse(response *domain.Response)
SetResponse sets the response to display.
func (ResponseModel) Update ¶
func (m ResponseModel) Update(msg tea.Msg) (ResponseModel, tea.Cmd)
Update handles messages and updates the model.
type SaveDialogModel ¶
type SaveDialogModel struct {
// contains filtered or unexported fields
}
SaveDialogModel represents a dialog for saving a request with a name.
func NewSaveDialogModel ¶
func NewSaveDialogModel(defaultName string) SaveDialogModel
NewSaveDialogModel creates a new save dialog with optional default name.
func (SaveDialogModel) Init ¶
func (m SaveDialogModel) Init() tea.Cmd
Init initializes the save dialog.
func (SaveDialogModel) Update ¶
func (m SaveDialogModel) Update(msg tea.Msg) (SaveDialogModel, tea.Cmd)
Update handles messages for the save dialog.
func (SaveDialogModel) View ¶
func (m SaveDialogModel) View() string
View renders the save dialog as a centered modal overlay.