ui

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("160")).
				Background(lipgloss.Color("52"))

	FocusedStyle   = lipgloss.NewStyle().Foreground(focusColor)
	UnfocusedStyle = lipgloss.NewStyle().Foreground(unfocusColor)

	FocusedButton = lipgloss.NewStyle().
					Foreground(lipgloss.Color("205")).
					Bold(true)

	UnfocusedButton = lipgloss.NewStyle().
					Foreground(lipgloss.Color("240"))

	DocStyle = lipgloss.NewStyle().Margin(1, 2)

	// TODO: add parent base style
	HelpStyle = lipgloss.NewStyle().
				Margin(1, 2)

	HeaderStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				Height(2)

	// Header ASCII art styles
	HeaderLogoStyle = lipgloss.NewStyle().
					Bold(true).
					Foreground(darkPurple)

	HeaderHelpStyle = lipgloss.NewStyle().
					Foreground(dimGray)

	SidebarStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					Width(20)

	RequestStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder())

	ResponseStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder())

	LabelStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("241"))

	LoadTestBorderStyle = lipgloss.NewStyle().
						BorderStyle(lipgloss.RoundedBorder()).
						BorderForeground(lipgloss.Color("226")) // Yellow
)

Functions

func ApplyFocus

func ApplyFocus(style lipgloss.Style, focus bool) lipgloss.Style

func DeleteRequestCmd

func DeleteRequestCmd(db *storage.SQLiteStorage, id int64) tea.Cmd

func LoadRequestsCmd

func LoadRequestsCmd(db *storage.SQLiteStorage) tea.Cmd

func SaveRequestCmd

func SaveRequestCmd(db *storage.SQLiteStorage, request *http.Request) tea.Cmd

func SetRequestPaneRequestCmd

func SetRequestPaneRequestCmd(request *http.Request) tea.Cmd

func StartLoadTestCmd

func StartLoadTestCmd(config *http.JobConfig) tea.Cmd

func WaitForLoadTestUpdatesCmd

func WaitForLoadTestUpdatesCmd(updates <-chan *http.LoadTestStats, totalRequests int) tea.Cmd

Types

type FocusManager

type FocusManager struct {
	// contains filtered or unexported fields
}

func NewFocusManager

func NewFocusManager(components []Focusable) *FocusManager

func NewFocusManagerWithIndex

func NewFocusManagerWithIndex(components []Focusable, index int) *FocusManager

NewFocusManagerWithIndex creates a FocusManager starting at a specific index

func (*FocusManager) Current

func (f *FocusManager) Current() Focusable

func (*FocusManager) CurrentIndex

func (f *FocusManager) CurrentIndex() int

func (*FocusManager) Next

func (f *FocusManager) Next()

func (*FocusManager) Prev

func (f *FocusManager) Prev()

type Focusable

type Focusable interface {
	Focus() tea.Cmd
	Blur()
}
type Header struct {
	// contains filtered or unexported fields
}

func SetupHeader

func SetupHeader() *Header

func (*Header) Init

func (h *Header) Init() tea.Cmd

func (*Header) Update

func (h *Header) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Header) View

func (h *Header) View() string

type MethodSelector

type MethodSelector struct {
	// contains filtered or unexported fields
}

func NewMethodSelector

func NewMethodSelector() *MethodSelector

func (*MethodSelector) Blur

func (m *MethodSelector) Blur()

func (*MethodSelector) Current

func (m *MethodSelector) Current() string

func (*MethodSelector) Focus

func (m *MethodSelector) Focus() tea.Cmd

func (*MethodSelector) GetStyle

func (m *MethodSelector) GetStyle() lipgloss.Style

func (*MethodSelector) Next

func (m *MethodSelector) Next()

func (*MethodSelector) Prev

func (m *MethodSelector) Prev()

func (*MethodSelector) SetCurrentIndex

func (m *MethodSelector) SetCurrentIndex(method string)

type RequestDeletedMsg

type RequestDeletedMsg struct {
	ID  int64
	Err error
}

type RequestItem

type RequestItem struct {
	Request *http.Request
	// contains filtered or unexported fields
}

func (RequestItem) Description

func (i RequestItem) Description() string

func (RequestItem) FilterValue

func (i RequestItem) FilterValue() string

func (RequestItem) Title

func (i RequestItem) Title() string

type RequestSavedMsg

type RequestSavedMsg struct {
	Request *http.Request
	Err     error
}

type RequestsLoadingMsg

type RequestsLoadingMsg struct {
	Requests []http.Request
	Err      error
}

type ResponsePane

type ResponsePane struct {
	Response      *http.Response
	LoadTestStats *http.LoadTestStats
	// contains filtered or unexported fields
}

func SetupResponsePane

func SetupResponsePane() ResponsePane

func (*ResponsePane) ClearLoadTestStats

func (m *ResponsePane) ClearLoadTestStats()

func (ResponsePane) Init

func (m ResponsePane) Init() tea.Cmd

func (*ResponsePane) SetHeight

func (m *ResponsePane) SetHeight(height int)

func (*ResponsePane) SetLoadTestStats

func (m *ResponsePane) SetLoadTestStats(stats *http.LoadTestStats)

func (*ResponsePane) SetResponse

func (m *ResponsePane) SetResponse(response *http.Response)

func (*ResponsePane) SetWidth

func (m *ResponsePane) SetWidth(width int)

func (*ResponsePane) Update

func (m *ResponsePane) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (ResponsePane) View

func (m ResponsePane) View() string

type SetRequestPaneRequestMsg

type SetRequestPaneRequestMsg struct {
	Request *http.Request
}

type SidebarPane

type SidebarPane struct {
	// contains filtered or unexported fields
}

func NewSidebar

func NewSidebar(db *storage.SQLiteStorage) *SidebarPane

func (*SidebarPane) Init

func (s *SidebarPane) Init() tea.Cmd

func (*SidebarPane) SelectedItem

func (s *SidebarPane) SelectedItem() (RequestItem, bool)

func (*SidebarPane) SetRequests

func (s *SidebarPane) SetRequests(items []list.Item)

func (*SidebarPane) SetSize

func (s *SidebarPane) SetSize(width, height int)

func (*SidebarPane) Update

func (s *SidebarPane) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*SidebarPane) View

func (s *SidebarPane) View() string

type SubmitButton

type SubmitButton struct {
	// contains filtered or unexported fields
}

func NewSubmitButton

func NewSubmitButton() *SubmitButton

func (*SubmitButton) Blur

func (s *SubmitButton) Blur()

func (*SubmitButton) Focus

func (s *SubmitButton) Focus() tea.Cmd

func (*SubmitButton) IsFocused

func (s *SubmitButton) IsFocused() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL