Documentation
¶
Index ¶
- Constants
- Variables
- func AddInputFieldEventForm(form *tview.Form, itemLabel string)
- func FormatLog(message string, mode string) string
- func GetDropDownFieldForm(form *tview.Form, itemLabel string) *tview.DropDown
- func GetInputFieldForm(form *tview.Form, itemLabel string) *tview.InputField
- func MakeSeparator(color tcell.Color) *tview.Box
- func MakeTitlePrmt(title string) *tview.Flex
- func ReadFile(filename string, logger func(message string, mode string)) []byte
- func ReadFromClipboard() (string, error)
- func WriteToClipboard(data string, logger func(message string, event string))
Constants ¶
const ( BackColorName = "#2B2B2B" BackBlueColorName = "#214283" BackGrayColorName = "#424445" BlueColorName = "dodgerblue" GreenColorName = "#629755" )
Represents App color list
const ( TreePrmtTitle = "Requests" GitHubTViewURL = "https://godoc.org/github.com/rivo/tview" Title = "GTTP" Subtitle = Title + " - Go HTTP Client for Terminal UIs" TitleShortcuts = "Press [" + BlueColorName + "::ub]Escape[white::-] or Ctrl+[" + BlueColorName + "::ub]Q[white::-] to exit" GitHubLink = "~//github.com/joakim-ribier/gttp" )
Represents App global information
const ( JShortcut = "Ctrl+[" + BlueColorName + "::ub]J[white::-]" EShortcut = "Ctrl+[" + BlueColorName + "::ub]E[white::-]" ExecuteShortcut = EShortcut + " Execute" SelectAPIShortcut = JShortcut + " Select API" SettingsShortcut = "Ctrl+[" + BlueColorName + "::ub]O[white::-] Settings" ShortcutD = "Ctrl+[" + BlueColorName + "::ub]W[white::-] Response View" ShortcutF = "Ctrl+[" + BlueColorName + "::ub]F[white::-] Make Request" ShortcutH = "Ctrl+[" + BlueColorName + "::ub]H[white::-] Expert Mode" ShortcutQ = "Ctrl+[" + BlueColorName + "::ub]Q[white::-] Exit" ShortcutR = "Ctrl+[" + BlueColorName + "::ub]R[white::-] Request Header View" ShortcutDC = "Ctrl+[" + BlueColorName + "::ub]C[white::-] Copy Response" ShortcutDA = "Ctrl+[" + BlueColorName + "::ub]A[white::-] Copy All (log)" ShortcutHSubMenu = ShortcutH + " >> Ctrl+[" + BlueColorName + "::ub]Down[white::-] Left Menu >> Select Letter (or press down/up)" SettingsShortcutSubMenu = SettingsShortcut + " >> Ctrl+[" + BlueColorName + "::ub]Down[white::-] Left Menu >> Select Letter (or press down/up)" ShortcutSRSubMenu = " Save Request >> Ctrl+[" + BlueColorName + "::ub]Down[white::-] Left Menu >> Select Letter (or press down/up)" ShortcutPressEscape = "Press Escape" ShortcutSeparator = " | " )
Represents App shortcuts list
Variables ¶
var ( BackColor = tcell.GetColor(BackColorName) BackBlueColor = tcell.GetColor(BackBlueColorName) BackGrayColor = tcell.GetColor(BackGrayColorName) )
var ( MainShortcutsText = strings.Join([]string{SelectAPIShortcut, ShortcutF, ShortcutH, ShortcutD, SettingsShortcut, ShortcutQ}, ShortcutSeparator) ResultShortcutsText = strings.Join([]string{ShortcutR, ShortcutDC, ShortcutDA, ShortcutPressEscape}, ShortcutSeparator) ExpertModeShortcutsText = strings.Join([]string{ShortcutHSubMenu, ShortcutPressEscape}, ShortcutSeparator) SettingsShortcutsText = strings.Join([]string{SettingsShortcutSubMenu, ShortcutPressEscape}, ShortcutSeparator) )
Represents data shortcuts to display to the user
var ( MethodValues = core.StringSlice{"GET", "POST", "PUT"} ContentTypeValues = core.StringSlice{ "application/javascript", "application/json", "application/x-www-form-urlencoded", "application/xml", "application/zip", "application/pdf", "application/sql", "application/graphql", "application/ld+json", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.ms-powerpoint", "application/vnd.openxmlformats-officedocument.presentationml.presentation", "application/vnd.oasis.opendocument.text", "audio/mpeg", "audio/ogg", "multipart/form-data", "text/css", "text/html", "text/xml", "text/csv", "text/plain", "image/png", "image/jpeg", "image/gif", } )
Represents data to make a new request
Functions ¶
func AddInputFieldEventForm ¶
AddInputFieldEventForm add generic event to inputfield
func GetDropDownFieldForm ¶
GetDropDownFieldForm get a dropdown field by label from the form
func GetInputFieldForm ¶
func GetInputFieldForm(form *tview.Form, itemLabel string) *tview.InputField
GetInputFieldForm get an inputfield field by label from the form
func MakeSeparator ¶
MakeSeparator create a simple tview.NewBox
func MakeTitlePrmt ¶
MakeTitlePrmt builds a title widget
func ReadFile ¶
ReadFile reads the file @filename and return the content. If ioutil.ReadFile return an error, method logs and returns an empty cotent ([]byte).
func ReadFromClipboard ¶
ReadFromClipboard reads data from the clipboard
func WriteToClipboard ¶
WriteToClipboard writes data to the clipboard (Ctrl+C for example)
Types ¶
This section is empty.