cwriter

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: May 27, 2017 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const ESC = 27

ESC is the ASCII code for escape character

Variables

This section is empty.

Functions

func GetTermSize

func GetTermSize() (width, height int, err error)

GetTermSize returns the dimensions of the given terminal. the code is stolen from "golang.org/x/crypto/ssh/terminal"

Types

type Writer

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

Writer is a buffered the writer that updates the terminal. The contents of writer will be flushed when Flush is called.

func New

func New(w io.Writer) *Writer

New returns a new Writer with defaults

func (*Writer) Flush

func (w *Writer) Flush() error

Flush flushes the underlying buffer

func (*Writer) Write

func (w *Writer) Write(b []byte) (n int, err error)

Write save the contents of b to its buffers. The only errors returned are ones encountered while writing to the underlying buffer.

Jump to

Keyboard shortcuts

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