Documentation ¶
Index ¶
- Variables
- func LFtoCRLF(data []byte) []byte
- func NewFD(name string, r io.ReadCloser, w io.WriteCloser) io.ReadWriteCloser
- func NewPipe() (io.ReadCloser, io.WriteCloser)
- func NopWriter(w io.Writer) io.WriteCloser
- type DefaultLdisc
- func (d *DefaultLdisc) Close() error
- func (d *DefaultLdisc) GetESC() chan string
- func (d *DefaultLdisc) IOctl()
- func (d *DefaultLdisc) ReadRuneBuff() []rune
- func (d *DefaultLdisc) ReceiveMustarBuff(n int, mInFD *PortFD)
- func (d *DefaultLdisc) ReceiveSluvaBuff(n int, sInFD *PortFD)
- func (d *DefaultLdisc) SetBuff(s string)
- func (d *DefaultLdisc) SetMustarFD(fd io.ReadWriteCloser)
- func (d *DefaultLdisc) SetSluvaFD(fd io.ReadWriteCloser)
- type Ldisc
- type MultiUserLdisc
- func (m *MultiUserLdisc) Close() error
- func (m *MultiUserLdisc) GetESC() chan string
- func (m *MultiUserLdisc) IOctl()
- func (m *MultiUserLdisc) ReadRuneBuff() []rune
- func (m *MultiUserLdisc) ReceiveMustarBuff(n int, mInFD *PortFD)
- func (m *MultiUserLdisc) ReceiveSluvaBuff(n int, sInFD *PortFD)
- func (m *MultiUserLdisc) SetBuff(s string)
- func (m *MultiUserLdisc) SetMustarFD(fd io.ReadWriteCloser)
- func (m *MultiUserLdisc) SetSluvaFD(fd io.ReadWriteCloser)
- type Port
- type PortFD
- type Prompt
- type RawLdisc
- func (r *RawLdisc) Close() error
- func (r *RawLdisc) GetESC() chan string
- func (r *RawLdisc) IOctl()
- func (r *RawLdisc) ReadRuneBuff() []rune
- func (r *RawLdisc) ReceiveMustarBuff(n int, mInFD *PortFD)
- func (r *RawLdisc) ReceiveSluvaBuff(n int, sInFD *PortFD)
- func (r *RawLdisc) SetBuff(s string)
- func (r *RawLdisc) SetMustarFD(fd io.ReadWriteCloser)
- func (r *RawLdisc) SetSluvaFD(fd io.ReadWriteCloser)
- type VPTY2
- func (v *VPTY2) Close() error
- func (v *VPTY2) CursorMustar(p *Port) error
- func (v *VPTY2) CursorSluva(p *Port) error
- func (v *VPTY2) DestroyPort(p *Port) error
- func (v *VPTY2) GetLDisc() (ldisc Ldisc)
- func (v *VPTY2) MustarFD() *PortFD
- func (v *VPTY2) NewMustarPort() *Port
- func (v *VPTY2) NewSluvaPort() *Port
- func (v *VPTY2) SetLDisc(ldisc Ldisc)
- func (v *VPTY2) SluvaFD() *PortFD
- type WriteCloserTicker
Constants ¶
This section is empty.
Variables ¶
View Source
var Backspace string = string([]byte{127})
View Source
var CarriageReturn string = "\r"
View Source
var CtrlC string = string([]byte{3})
View Source
var CursorDown string = "\033[B"
View Source
var CursorEnd string = "\033[F"
View Source
var CursorHome string = "\033[H"
View Source
var CursorLeft string = "\033[D"
View Source
var CursorRight string = "\033[C"
View Source
var CursorUp string = "\033[A"
View Source
var DefaultEscSet map[string]string = map[string]string{ CursorUp: "", CursorDown: "", CursorLeft: "", CursorRight: "", Backspace: "", CtrlC: "", CursorHome: "", CursorEnd: "", Delete: "", }
View Source
var Delete string = "\033[3~"
View Source
var ErrClosedPipe = io.ErrClosedPipe
View Source
var HandleScapeMode = false
I+D+I
View Source
var LineFeed string = "\n"
Functions ¶
func NewFD ¶
func NewFD(name string, r io.ReadCloser, w io.WriteCloser) io.ReadWriteCloser
func NewPipe ¶
func NewPipe() (io.ReadCloser, io.WriteCloser)
Types ¶
type DefaultLdisc ¶
type DefaultLdisc struct { ERR chan error // LineBuff []byte RuneBuff []rune CursorOffset int ESC chan string ECO bool // ESCSet map[string]string // contains filtered or unexported fields }
func NewDefaultLdisc ¶
func NewDefaultLdisc() *DefaultLdisc
func (*DefaultLdisc) Close ¶
func (d *DefaultLdisc) Close() error
func (*DefaultLdisc) GetESC ¶
func (d *DefaultLdisc) GetESC() chan string
func (*DefaultLdisc) IOctl ¶
func (d *DefaultLdisc) IOctl()
func (*DefaultLdisc) ReadRuneBuff ¶
func (d *DefaultLdisc) ReadRuneBuff() []rune
func (*DefaultLdisc) ReceiveMustarBuff ¶
func (d *DefaultLdisc) ReceiveMustarBuff(n int, mInFD *PortFD)
Called from vpty on mustar port write. Read -> process -> Write to sluva FD
func (*DefaultLdisc) ReceiveSluvaBuff ¶
func (d *DefaultLdisc) ReceiveSluvaBuff(n int, sInFD *PortFD)
func (*DefaultLdisc) SetBuff ¶
func (d *DefaultLdisc) SetBuff(s string)
func (*DefaultLdisc) SetMustarFD ¶
func (d *DefaultLdisc) SetMustarFD(fd io.ReadWriteCloser)
func (*DefaultLdisc) SetSluvaFD ¶
func (d *DefaultLdisc) SetSluvaFD(fd io.ReadWriteCloser)
type Ldisc ¶
type Ldisc interface { SetMustarFD(io.ReadWriteCloser) SetSluvaFD(io.ReadWriteCloser) // Call it to disable this ldisc Close() error // interface to control ldisc, WIP IOctl() // To be called from vpty on // mustar/sluva writes ReceiveMustarBuff(int, *PortFD) ReceiveSluvaBuff(int, *PortFD) // ReadRuneBuff() []rune SetBuff(s string) GetESC() chan string }
type MultiUserLdisc ¶
type MultiUserLdisc struct { MustarWriteCount int MustarReadCount int // contains filtered or unexported fields }
func NewMultiUserLdisc ¶
func NewMultiUserLdisc() *MultiUserLdisc
func (*MultiUserLdisc) Close ¶
func (m *MultiUserLdisc) Close() error
func (*MultiUserLdisc) IOctl ¶
func (m *MultiUserLdisc) IOctl()
func (*MultiUserLdisc) ReceiveMustarBuff ¶
func (m *MultiUserLdisc) ReceiveMustarBuff(n int, mInFD *PortFD)
func (*MultiUserLdisc) ReceiveSluvaBuff ¶
func (m *MultiUserLdisc) ReceiveSluvaBuff(n int, sInFD *PortFD)
func (*MultiUserLdisc) SetMustarFD ¶
func (m *MultiUserLdisc) SetMustarFD(fd io.ReadWriteCloser)
func (*MultiUserLdisc) SetSluvaFD ¶
func (m *MultiUserLdisc) SetSluvaFD(fd io.ReadWriteCloser)
type PortFD ¶
type PortFD struct {
// contains filtered or unexported fields
}
PortFD the internal or external part of the two pipes of *Port
func (*PortFD) GetRawR ¶
func (fd *PortFD) GetRawR() io.ReadCloser
func (*PortFD) GetRawW ¶
func (fd *PortFD) GetRawW() io.WriteCloser
type Prompt ¶
type Prompt struct { PS1 []byte // contains filtered or unexported fields }
Prompt struct. A helper to write shell prompts asking for a input abstracting the origin of the app and the input source. This means that the source and/or the app can be local or remote. This should be used with VPTY2 that handles all the complex stuff. This pieze allows to have a PS prompt, line edit and history.
func NewPrompt ¶
func NewPrompt(vpty *VPTY2, stdin io.ReadCloser, stdout io.WriteCloser) *Prompt
type RawLdisc ¶
type RawLdisc struct {
// contains filtered or unexported fields
}
func NewRawLdisc ¶
func NewRawLdisc() *RawLdisc
func (*RawLdisc) ReceiveMustarBuff ¶
func (*RawLdisc) ReceiveSluvaBuff ¶
func (*RawLdisc) SetMustarFD ¶
func (r *RawLdisc) SetMustarFD(fd io.ReadWriteCloser)
func (*RawLdisc) SetSluvaFD ¶
func (r *RawLdisc) SetSluvaFD(fd io.ReadWriteCloser)
type VPTY2 ¶
type VPTY2 struct {
// contains filtered or unexported fields
}
func NewVirtPTY ¶
func NewVirtPTY() *VPTY2
func (*VPTY2) CursorMustar ¶
func (*VPTY2) CursorSluva ¶
func (*VPTY2) DestroyPort ¶
func (*VPTY2) MustarFD ¶
MustarFD file descriptor for term write here keyboard input (os.Stdin) read from here the term data (and write to os.Stdout)
func (*VPTY2) NewMustarPort ¶
func (*VPTY2) NewSluvaPort ¶
NewSluvaPort create new sluva port, it will stored
type WriteCloserTicker ¶
type WriteCloserTicker struct {
// contains filtered or unexported fields
}
func (*WriteCloserTicker) Close ¶
func (t *WriteCloserTicker) Close() error
Click to show internal directories.
Click to hide internal directories.