MCPcopy
hub / github.com/c-bata/go-prompt / ConsoleParser

Interface ConsoleParser

input.go:12–21  ·  view source on GitHub ↗

ConsoleParser is an interface to abstract input layer.

Source from the content-addressed store, hash-verified

10
11// ConsoleParser is an interface to abstract input layer.
12type ConsoleParser interface {
13 // Setup should be called before starting input
14 Setup() error
15 // TearDown should be called after stopping input
16 TearDown() error
17 // GetWinSize returns WinSize object to represent width and height of terminal.
18 GetWinSize() *WinSize
19 // Read returns byte array.
20 Read() ([]byte, error)
21}
22
23// GetKey returns Key correspond to input byte codes.
24func GetKey(b []byte) Key {

Callers 9

RunMethod · 0.65
setUpMethod · 0.65
RunMethod · 0.65
tearDownMethod · 0.65
setUpMethod · 0.65
handleSignalsMethod · 0.65
readBufferMethod · 0.65
ReadMethod · 0.65
readBufferFunction · 0.65

Implementers 2

PosixParserinput_posix.go
WindowsParserinput_windows.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…