term_view

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: MIT Imports: 11 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

This section is empty.

Types

type FdWriter

type FdWriter interface {
	io.Writer
	Fd() uintptr
}

FdWriter is a writer with a file descriptor.

type ProgressLog

type ProgressLog struct {
	Writer *Writer // terminal writer  todo defer Flush
	// contains filtered or unexported fields
}

func NewPLog

func NewPLog(cr *wss.ConnRecord) *ProgressLog

func (*ProgressLog) SetLogBuffer added in v0.3.1

func (p *ProgressLog) SetLogBuffer(r *wss.ConnRecord)

set progress log(connection table), the connection table is write into p.Write (p.Write is a bytes buffer, only really output to screen when calling Flush).

func (*ProgressLog) Write

func (p *ProgressLog) Write(buf []byte) (int, error)

write interface: write buffer data directly to stdout.

type Writer

type Writer struct {
	OutDev io.Writer
	// contains filtered or unexported fields
}

Writer will updates the terminal when flush is called.

func NewWriter

func NewWriter() *Writer

NewWriter returns a new Writer with default values

func (*Writer) ClearLines added in v0.5.0

func (w *Writer) ClearLines()

wrapper function to call clearLines on different platform

func (*Writer) Flush

func (w *Writer) Flush(onLinesCleared func() error) error

Flush writes to the out and resets the buffer.

func (*Writer) NormalWrite

func (w *Writer) NormalWrite(buf []byte) (n int, err error)

Write write contents to the writer's io writer.

func (*Writer) Write

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

Jump to

Keyboard shortcuts

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