Documentation ¶
Index ¶
- Constants
- type FdReader
- type FdWriter
- type Multiplexer
- func (m *Multiplexer) Close()
- func (m *Multiplexer) HandleInputDone()
- func (m *Multiplexer) MakeRawFdReader(fdNum int, fd io.ReadCloser, shouldClose bool, isPty bool)
- func (m *Multiplexer) MakeRawFdWriter(fdNum int, fd io.WriteCloser, shouldClose bool, desc string)
- func (m *Multiplexer) MakeReaderPipe(fdNum int) (*os.File, error)
- func (m *Multiplexer) MakeStaticWriterPipe(fdNum int, data []byte, bufferLimit int, desc string) (*os.File, error)
- func (m *Multiplexer) MakeWriterPipe(fdNum int, desc string) (*os.File, error)
- func (m *Multiplexer) RunIOAndWait(packetParser *packet.PacketParser, sender *packet.PacketSender, ...) *packet.CmdDonePacketType
- func (m *Multiplexer) WriteDataToFd(fdNum int, data []byte, isEof bool) error
Constants ¶
View Source
const MaxSingleWriteSize = 4 * 1024
View Source
const MaxTotalRunDataSize = 10 * ReadBufSize
View Source
const ReadBufSize = 128 * 1024
View Source
const WriteBufSize = 128 * 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FdReader ¶
type FdReader struct { CVar *sync.Cond M *Multiplexer FdNum int Fd io.ReadCloser BufSize int Closed bool ShouldCloseFd bool IsPty bool }
func MakeFdReader ¶
func MakeFdReader(m *Multiplexer, fd io.ReadCloser, fdNum int, shouldCloseFd bool, isPty bool) *FdReader
func (*FdReader) GetBufSize ¶
type FdWriter ¶
type FdWriter struct { CVar *sync.Cond M *Multiplexer FdNum int Buffer []byte BufferLimit int Fd io.WriteCloser Eof bool Closed bool ShouldCloseFd bool Desc string }
func MakeFdWriter ¶
func MakeFdWriter(m *Multiplexer, fd io.WriteCloser, fdNum int, shouldCloseFd bool, desc string) *FdWriter
func (*FdWriter) WaitForData ¶
type Multiplexer ¶
type Multiplexer struct { Lock *sync.Mutex CK base.CommandKey FdReaders map[int]*FdReader // synchronized FdWriters map[int]*FdWriter // synchronized RunData map[int]*FdReader // synchronized CloseAfterStart []*os.File // synchronized Sender *packet.PacketSender Input *packet.PacketParser Started bool UPR packet.UnknownPacketReporter Debug bool }
func MakeMultiplexer ¶
func MakeMultiplexer(ck base.CommandKey, upr packet.UnknownPacketReporter) *Multiplexer
func (*Multiplexer) Close ¶
func (m *Multiplexer) Close()
func (*Multiplexer) HandleInputDone ¶
func (m *Multiplexer) HandleInputDone()
func (*Multiplexer) MakeRawFdReader ¶
func (m *Multiplexer) MakeRawFdReader(fdNum int, fd io.ReadCloser, shouldClose bool, isPty bool)
func (*Multiplexer) MakeRawFdWriter ¶
func (m *Multiplexer) MakeRawFdWriter(fdNum int, fd io.WriteCloser, shouldClose bool, desc string)
func (*Multiplexer) MakeReaderPipe ¶
func (m *Multiplexer) MakeReaderPipe(fdNum int) (*os.File, error)
returns the *writer* to connect to process, reader is put in FdReaders
func (*Multiplexer) MakeStaticWriterPipe ¶
func (m *Multiplexer) MakeStaticWriterPipe(fdNum int, data []byte, bufferLimit int, desc string) (*os.File, error)
returns the *reader* to connect to process, writer is put in FdWriters
func (*Multiplexer) MakeWriterPipe ¶
returns the *reader* to connect to process, writer is put in FdWriters
func (*Multiplexer) RunIOAndWait ¶
func (m *Multiplexer) RunIOAndWait(packetParser *packet.PacketParser, sender *packet.PacketSender, waitOnReaders bool, waitOnWriters bool, waitForInputLoop bool) *packet.CmdDonePacketType
func (*Multiplexer) WriteDataToFd ¶
func (m *Multiplexer) WriteDataToFd(fdNum int, data []byte, isEof bool) error
Click to show internal directories.
Click to hide internal directories.