Documentation ¶
Index ¶
- func EnableColorsStdout(enabled *bool) func()
- func IsCygwinTerminal(fd uintptr) bool
- func IsReaderTerminal(file io.Reader) bool
- func IsTerminal(fd uintptr) bool
- func IsWriterTerminal(file io.Writer) bool
- func NewColorable(file io.Writer) io.Writer
- func NewColorableStderr() io.Writer
- func NewColorableStdout() io.Writer
- func NewNonColorableReader(r io.Reader) io.Reader
- func NewNonColorableWriter(w io.Writer) io.Writer
- func NewNonConsoleSymbolWriter(w io.Writer, conf NonConsoleSymbolConf) io.Writer
- type ConsoleSymbol
- type NonConsoleSymbolConf
- type NonConsoleSymbolReader
- type NonConsoleSymbolWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnableColorsStdout ¶
func EnableColorsStdout(enabled *bool) func()
EnableColorsStdout enable colors if possible.
func IsCygwinTerminal ¶
func IsReaderTerminal ¶
func IsTerminal ¶
func IsWriterTerminal ¶
func NewColorable ¶
NewColorable returns new instance of Writer which handles escape sequence.
func NewColorableStderr ¶
NewColorableStderr returns new instance of Writer which handles escape sequence for stderr.
func NewColorableStdout ¶
NewColorableStdout returns new instance of Writer which handles escape sequence for stdout.
func NewNonColorableWriter ¶
NewNonColorable returns new instance of Writer which removes escape sequence from Writer.
func NewNonConsoleSymbolWriter ¶
func NewNonConsoleSymbolWriter(w io.Writer, conf NonConsoleSymbolConf) io.Writer
Types ¶
type ConsoleSymbol ¶
type ConsoleSymbol byte
const ( T_A ConsoleSymbol = 'A' // 光标上移 \ cursor up T_B ConsoleSymbol = 'B' // 光标下移 \ cursor down T_C ConsoleSymbol = 'C' // 光标右移 \ cursor right T_D ConsoleSymbol = 'D' // 光标左移 \ cursor left T_E ConsoleSymbol = 'E' // 光标下移到下一行的开头 \ cursor down to the beginning of the next line T_F ConsoleSymbol = 'F' // 光标上移到上一行的开头 \ cursor up to the beginning of the previous line T_G ConsoleSymbol = 'G' // 光标移动到当前行的指定列 \ cursor moves to the specified column of the current line T_H ConsoleSymbol = 'H' // 光标移动到指定行和列 \ cursor moves to the specified row and column T_J ConsoleSymbol = 'J' // 清屏或清除从光标到屏幕的一部分 \ clear the screen or clear part of the screen from the cursor T_K ConsoleSymbol = 'K' // 清除从光标到行尾的一部分 \ clear part of the line from the cursor to the end of the line T_S ConsoleSymbol = 'S' // 向上滚动指定的行数 \ scroll up the specified number of lines T_T ConsoleSymbol = 'T' // 向下滚动指定的行数 \ scroll down the specified number of lines T_m ConsoleSymbol = 'm' // 设置颜色和格式 \ set color and format T_s ConsoleSymbol = 's' // 保存光标位置 \ save cursor position T_u ConsoleSymbol = 'u' // 恢复光标位置 \ restore cursor position )
type NonConsoleSymbolConf ¶
type NonConsoleSymbolConf struct { Ignore []ConsoleSymbol IgnoreAll bool }
type NonConsoleSymbolReader ¶
type NonConsoleSymbolReader struct {
// contains filtered or unexported fields
}
func NewNonConsoleSymbolReader ¶
func NewNonConsoleSymbolReader(r io.Reader, conf NonConsoleSymbolConf) *NonConsoleSymbolReader
type NonConsoleSymbolWriter ¶
type NonConsoleSymbolWriter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.