Documentation
¶
Index ¶
- func Println(in string, data interface{}, fs ...string) error
- func PrintlnTmpl(tmpl string, data interface{}, fs ...string) error
- type ScreenBuf
- func (s *ScreenBuf) Flush() error
- func (s *ScreenBuf) Render(in string, data interface{}) error
- func (s *ScreenBuf) RenderTmpl(tmpl string, data interface{}) error
- func (s *ScreenBuf) Reset() error
- func (s *ScreenBuf) Write(in string, data interface{}) error
- func (s *ScreenBuf) WriteTmpl(tmpl string, data interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintlnTmpl ¶
PrintlnTmpl will print a formatted string out to a writer
Types ¶
type ScreenBuf ¶
type ScreenBuf struct {
// contains filtered or unexported fields
}
ScreenBuf is a convenient way to write to terminal screens. It creates, clears and, moves up or down lines as needed to write the output to the terminal using ANSI escape codes.
func NewScreenBuf ¶
NewScreenBuf creates and initializes a new ScreenBuf.
func (*ScreenBuf) Flush ¶
Flush will flush the render buffer to the screen, this should be called after sever calls to Write
func (*ScreenBuf) Render ¶
Render will write a text/template out to the console, using a mutex so that only a single writer at a time can write. This prevents the buffer from losing sync with the newlines
func (*ScreenBuf) RenderTmpl ¶
RenderTmpl will write an already parsed text/template out to the console, using a mutex so that only a single writer at a time can write. This prevents the buffer from losing sync with the newlines
func (*ScreenBuf) Reset ¶
Reset will empty the buffer and refill it with control characters that will clear the previous data on the next flush call.