Documentation ¶
Overview ¶
* user input & ANSI terminal colors
Index ¶
- Constants
- Variables
- func GetColor(n string) tcell.Color
- func NewFlags() *flags
- func NewMooze() *mooze
- func Run()
- func ToStyle(f ...string) tcell.Style
- type BackColorEnum
- type Bg
- type Color
- type ColorContext
- type Fg
- type FrontColorEnum
- type HistoryWriter
- type Mode
- type MoozeEditor
- type MoozeRequest
- func (r *MoozeRequest) Method(m int)
- func (r *MoozeRequest) ParseJson(s string) *bytes.Buffer
- func (r *MoozeRequest) Prettify(data []byte) []string
- func (r *MoozeRequest) ResBody(res *http.Response) []byte
- func (r *MoozeRequest) Send(m methodtype, args ReqArgs) *http.Response
- func (r *MoozeRequest) Url(u string)
- type MoozeScreen
- func (m *MoozeScreen) Clear()
- func (m *MoozeScreen) DefaultStyle() tcell.Style
- func (m *MoozeScreen) EmitEvent() tcell.Event
- func (m *MoozeScreen) Exit(code int)
- func (m *MoozeScreen) InitScreen(mouse bool)
- func (m *MoozeScreen) Print(y, x int, str string, style tcell.Style)
- func (m *MoozeScreen) PrintInsideWindow(mw *MoozeWindow, y, x int, str string, style tcell.Style)
- func (m *MoozeScreen) Reload()
- func (m *MoozeScreen) RenderWindow(w *MoozeWindow, style tcell.Style)
- func (m *MoozeScreen) Show()
- func (m *MoozeScreen) Size() (int, int)
- func (m *MoozeScreen) Sync()
- type MoozeWindow
- type Renderer
- func (r *Renderer) Backspace()
- func (r *Renderer) ClearConsoleUnix()
- func (r *Renderer) ClearLine()
- func (r *Renderer) HideCursor()
- func (r *Renderer) MoveCursorDown()
- func (r *Renderer) MoveCursorLeft()
- func (r *Renderer) MoveCursorRight()
- func (r *Renderer) MoveCursorTo(x, y int)
- func (r *Renderer) MoveCursorUp()
- func (r *Renderer) ReadChar(fd *os.File, buf []byte) int
- func (r *Renderer) RenderTextNoClear(x, y int, s string, a ...interface{})
- func (r *Renderer) RenderTextTo(x, y int, s string, a ...interface{})
- func (r *Renderer) RenderWindow(w *Window)
- func (r *Renderer) RestoreState(fd *os.File, s *terminal.State)
- func (r *Renderer) ShowCursor()
- func (r *Renderer) ToRawMode(fd *os.File) *terminal.State
- func (r *Renderer) TtyCol() int
- func (r *Renderer) TtyRow() int
- func (r *Renderer) UseNonblockIo(fd *os.File, b bool)
- func (r *Renderer) WriteChar(buf []byte)
- type ReqArgs
- type Response
- type StatusBar
- type Window
Constants ¶
View Source
const ( GET methodtype = iota POST PUT PATCH DELETE )
View Source
const ( CTRLA input = 1 CTRLJ input = 10 CTRLQ input = 17 CTRLS input = 19 CTRLENTER input = 10 TAB input = 9 // CTRL M == ENTER on UNIX ENTER input = 13 ESCAPE input = 27 BACKSPACE input = 127 SHIFTA input = 65 SHIFTU input = 85 A input = 97 B input = 98 H input = 104 I input = 105 M input = 109 O input = 111 Q input = 113 R input = 114 U input = 117 )
View Source
const ( NORMAL textEffect = 0 BOLD textEffect = 1 DIM textEffect = 2 UNDERLINED textEffect = 4 BLINK textEffect = 5 )
Variables ¶
View Source
var BColors = BackColorEnum{ // contains filtered or unexported fields }
View Source
var FColors = FrontColorEnum{ // contains filtered or unexported fields }
View Source
var MoozeStatusBar = NewStatusBar()
Functions ¶
Types ¶
type BackColorEnum ¶
type BackColorEnum struct {
// contains filtered or unexported fields
}
type Bg ¶
type Bg struct {
// contains filtered or unexported fields
}
for changing text background color
type Color ¶
func UndefinedColor ¶
func UndefinedColor() Color
type ColorContext ¶
type ColorContext struct {
// contains filtered or unexported fields
}
for changing text color & background color
func NewColorContext ¶
func NewColorContext(s ...string) *ColorContext
func (ColorContext) Colorize ¶
func (c ColorContext) Colorize(s string) string
func (ColorContext) HasBg ¶
func (c ColorContext) HasBg() bool
func (ColorContext) Print ¶
func (c ColorContext) Print(a ...interface{})
func (ColorContext) Printf ¶
func (c ColorContext) Printf(s string, a ...interface{})
func (ColorContext) Println ¶
func (c ColorContext) Println(a ...interface{})
type Fg ¶
type Fg struct {
// contains filtered or unexported fields
}
for changing text color uses RGB color
type FrontColorEnum ¶
type FrontColorEnum struct {
// contains filtered or unexported fields
}
type HistoryWriter ¶
type HistoryWriter struct {
// contains filtered or unexported fields
}
func NewHistoryWriter ¶
func NewHistoryWriter() *HistoryWriter
func (*HistoryWriter) Write ¶
func (h *HistoryWriter) Write(s string)
type MoozeEditor ¶
func NewMoozeEditor ¶
func NewMoozeEditor() *MoozeEditor
type MoozeRequest ¶
type MoozeRequest struct {
// contains filtered or unexported fields
}
func NewMoozeRequest ¶
func NewMoozeRequest() *MoozeRequest
func (*MoozeRequest) Method ¶
func (r *MoozeRequest) Method(m int)
func (*MoozeRequest) Prettify ¶
func (r *MoozeRequest) Prettify(data []byte) []string
func (*MoozeRequest) Url ¶
func (r *MoozeRequest) Url(u string)
type MoozeScreen ¶
type MoozeScreen struct {
// contains filtered or unexported fields
}
func NewMoozeScreen ¶
func NewMoozeScreen() *MoozeScreen
func (*MoozeScreen) Clear ¶
func (m *MoozeScreen) Clear()
func (*MoozeScreen) DefaultStyle ¶
func (m *MoozeScreen) DefaultStyle() tcell.Style
func (*MoozeScreen) EmitEvent ¶
func (m *MoozeScreen) EmitEvent() tcell.Event
func (*MoozeScreen) Exit ¶
func (m *MoozeScreen) Exit(code int)
func (*MoozeScreen) InitScreen ¶
func (m *MoozeScreen) InitScreen(mouse bool)
func (*MoozeScreen) PrintInsideWindow ¶
func (m *MoozeScreen) PrintInsideWindow( mw *MoozeWindow, y, x int, str string, style tcell.Style, )
if string length is bigger than window width replace the tail as '..'
func (*MoozeScreen) Reload ¶
func (m *MoozeScreen) Reload()
func (*MoozeScreen) RenderWindow ¶
func (m *MoozeScreen) RenderWindow(w *MoozeWindow, style tcell.Style)
func (*MoozeScreen) Show ¶
func (m *MoozeScreen) Show()
func (*MoozeScreen) Size ¶
func (m *MoozeScreen) Size() (int, int)
func (*MoozeScreen) Sync ¶
func (m *MoozeScreen) Sync()
type MoozeWindow ¶
type MoozeWindow struct {
// contains filtered or unexported fields
}
func NewMoozeWindow ¶
func NewMoozeWindow(x, y, sizeX, sizeY int, t bool) *MoozeWindow
func (*MoozeWindow) Content ¶
func (w *MoozeWindow) Content(c []string) *MoozeWindow
func (*MoozeWindow) ContentAppend ¶
func (w *MoozeWindow) ContentAppend(c []string) *MoozeWindow
func (*MoozeWindow) Title ¶
func (w *MoozeWindow) Title(t string) *MoozeWindow
type Renderer ¶
type Renderer struct { // row of cursor position CursorX int // column of cursor position CursorY int // contains filtered or unexported fields }
* col, y: width * --------------------------> * r | Screen * o | * w | * , | * x | * : | * V * height
func NewRenderer ¶
func NewRenderer() *Renderer
func (*Renderer) ClearConsoleUnix ¶
func (r *Renderer) ClearConsoleUnix()
func (*Renderer) HideCursor ¶
func (r *Renderer) HideCursor()
func (*Renderer) MoveCursorDown ¶
func (r *Renderer) MoveCursorDown()
func (*Renderer) MoveCursorLeft ¶
func (r *Renderer) MoveCursorLeft()
func (*Renderer) MoveCursorRight ¶
func (r *Renderer) MoveCursorRight()
func (*Renderer) MoveCursorTo ¶
move cursor to (x, y): x row & y col
func (*Renderer) MoveCursorUp ¶
func (r *Renderer) MoveCursorUp()
func (*Renderer) RenderTextNoClear ¶
func (*Renderer) RenderTextTo ¶
func (*Renderer) RenderWindow ¶
func (*Renderer) ShowCursor ¶
func (r *Renderer) ShowCursor()
type StatusBar ¶
func NewStatusBar ¶
func NewStatusBar() *StatusBar
Source Files ¶
Click to show internal directories.
Click to hide internal directories.