ui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATUS_VIEW      = "status"
	DELAY_VIEW       = "delay"
	HEADERS_VIEW     = "headers"
	BODY_VIEW        = "body"
	REQUEST_VIEW     = "request"
	INFO_VIEW        = "info"
	BODYFILE_VIEW    = "bodyfile"
	SAVE_VIEW        = "save"
	RESPONSES_VIEW   = "responses"
	BINDINGS_VIEW    = "bindings"
	FILE_DIALOG_VIEW = "file-dialog"
)

Variables

View Source
var Bindings = &bindings{
	{gocui.KeyTab, "Tab", "Next Input", nil, onNextView},
	{0xFF, "Shift+Tab", "Previous Input", nil, nil},
	{gocui.KeyCtrlA, "Ctrl+a", "Update Response", nil, onUpdateResponse},
	{gocui.KeyCtrlR, "Ctrl+r", "Reset Request history", nil, onResetRequests},
	{gocui.KeyCtrlS, "Ctrl+s", "Save Response as", nil, onSaveResponseAs},
	{gocui.KeyCtrlF, "Ctrl+f", "Save Request as", nil, onSaveRequestAs},
	{gocui.KeyCtrlL, "Ctrl+l", "Toggle Responses list", nil, onToggleResponsesList},
	{gocui.KeyCtrlT, "Ctrl+t", "Toggle Response builder", nil, onToggleResponseBuilder},
	{gocui.KeyCtrlO, "Ctrl+o", "Open Body file...", nil, onOpenFile},
	{gocui.KeyCtrlB, "Ctrl+b", "Switch Body mode", nil, onSwitchBodyMode},
	{gocui.KeyCtrlW, "Ctrl+w", "Toggle line wrapping", nil, onTogglLineWrapping},
	{'q', "q", "Close Popup", []string{"bindings", "responses"}, onClosePopup},
	{gocui.KeyPgup, "PgUp", "Previous Request", nil, onPrevRequest},
	{gocui.KeyPgdn, "PgDown", "Next Request", nil, onNextRequest},
	{gocui.KeyCtrlC, "Ctrl+c", "Quit", nil, onQuit},
}

Functions

This section is empty.

Types

type ActionFn

type ActionFn func(*gocui.Gui, *gocui.View) error

type Cursors

type Cursors map[string]struct {
	// contains filtered or unexported fields
}

Cursors stores the cursor position for a specific view this is used to restore mouse position when click is detected

func NewCursors

func NewCursors() Cursors

func (Cursors) Get

func (c Cursors) Get(view string) (int, int)

func (Cursors) Restore

func (c Cursors) Restore(view *gocui.View) error

func (Cursors) Set

func (c Cursors) Set(view string, x, y int)

type Split

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

func NewSplit

func NewSplit(size int) *Split

func (*Split) Current

func (s *Split) Current() int

func (*Split) Fixed

func (s *Split) Fixed(points ...int) *Split

func (*Split) Next

func (s *Split) Next() int

func (*Split) Relative

func (s *Split) Relative(points ...int) *Split

type UI

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

func New

func New(configPath string) *UI

func (*UI) AddRequest

func (ui *UI) AddRequest(g *gocui.Gui, req *http.Request) error

func (*UI) Display

func (ui *UI) Display(g *gocui.Gui, view string, bytes []byte) error

func (*UI) Info

func (ui *UI) Info(g *gocui.Gui, format string, args ...interface{})

func (*UI) Init

func (ui *UI) Init(g *gocui.Gui) (chan<- error, error)

func (*UI) Layout

func (ui *UI) Layout(g *gocui.Gui) error

func (*UI) Response

func (ui *UI) Response() *httplab.Response

Jump to

Keyboard shortcuts

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