refactor: decouple gotty app with terminal backends

This commit is contained in:
zlji
2017-01-10 00:13:36 +08:00
committed by Iwasaki Yudai
parent d71e2fcfa8
commit 496ef86339
6 changed files with 226 additions and 161 deletions

19
backends/interface.go Normal file
View File

@@ -0,0 +1,19 @@
package backends
import (
"io"
"net/url"
)
type ClientContextManager interface {
New(params url.Values) (ClientContext, error)
}
type ClientContext interface {
WindowTitle() (string, error)
Start(exitCh chan bool)
InputWriter() io.Writer
OutputReader() io.Reader
ResizeTerminal(width, height uint16) error
TearDown() error
}