cmd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NormalTitleStyle = lipgloss.NewStyle().
		Foreground(lipgloss.AdaptiveColor{Light: "#777777", Dark: "#777777"})
)

Functions

func LoadGlobalVarsFromHTTPFile

func LoadGlobalVarsFromHTTPFile(filename string) map[string]string

LoadGlobalVarsFromHTTPFile loads global variables from the postbear.http file

func SaveHTTPFile

func SaveHTTPFile(data *HTTPFileData, filename string) error

Save HTTPFileData to a .http file in the current working directory

func SendByCLI

func SendByCLI(method string, url string, simpleOutput bool, payloadIdx int)

Types

type HTTPFileData

type HTTPFileData struct {
	Requests   []HTTPRequest
	GlobalVars map[string]string
}

func LoadHTTPFile

func LoadHTTPFile(filename string) (*HTTPFileData, error)

LoadHTTPFile loads the HTTPFileData (requests and global vars) from a .http file

func (*HTTPFileData) ToHTTPFileFormat

func (h *HTTPFileData) ToHTTPFileFormat() string

Serialize HTTPFileData to .http file format

type HTTPRequest

type HTTPRequest struct {
	Name    string
	Method  string
	URL     string
	Headers string
	Body    string
	Params  string
}

type Model

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

func NewModel

func NewModel(filepath string) Model

func (Model) Init

func (m Model) Init() tea.Cmd

Init is run once when the program starts

func (Model) Update

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

func (Model) View

func (m Model) View() string

type ParamsTable

type ParamsTable struct {
	Rows       []TableRow
	FocusedRow int
	FocusedCol int // 0 for key, 1 for value
	// contains filtered or unexported fields
}

func NewParamsTable

func NewParamsTable() ParamsTable

func (*ParamsTable) AddRow

func (t *ParamsTable) AddRow()

func (*ParamsTable) SetFromQueryString

func (t *ParamsTable) SetFromQueryString(query string)

func (*ParamsTable) ToMap

func (t *ParamsTable) ToMap() map[string]string

func (*ParamsTable) ToQueryString

func (t *ParamsTable) ToQueryString() string

func (*ParamsTable) Update

func (t *ParamsTable) Update(msg tea.Msg, width int)

func (*ParamsTable) View

func (t *ParamsTable) View() string

type Styles

type Styles struct {
	Base,
	HeaderText,
	HeaderDecoration,
	Status,
	StatusHeader,
	Highlight,
	Help lipgloss.Style
}

func NewStyles

func NewStyles(lg *lipgloss.Renderer) *Styles

type TableRow

type TableRow struct {
	KeyInput   textinput.Model
	ValueInput textinput.Model
}

Jump to

Keyboard shortcuts

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