Documentation
¶
Overview ¶
Package stdioconn provides a net.Conn over a pair of files, such as the standard input and output of a process or the pipes to a child.
Index ¶
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) LocalAddr() net.Addr
- func (c *Conn) Read(b []byte) (int, error)
- func (c *Conn) RemoteAddr() net.Addr
- func (c *Conn) SetDeadline(t time.Time) error
- func (c *Conn) SetReadDeadline(t time.Time) error
- func (c *Conn) SetWriteDeadline(t time.Time) error
- func (c *Conn) Write(b []byte) (int, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a net.Conn that wraps a pipe and optionally an exec.Cmd.
func Spawn ¶
Spawn starts cmd with its standard input and output connected to the returned Conn. Close waits for cmd to exit. Stdin and Stdout should not be already set.
func (*Conn) Close ¶
Close closes both files and waits for the command, if any. It is safe to call more than once; later calls return the first result.
func (*Conn) RemoteAddr ¶
RemoteAddr returns a placeholder address.
func (*Conn) SetDeadline ¶
SetDeadline sets the read and write deadlines.
func (*Conn) SetReadDeadline ¶
SetReadDeadline sets the deadline on stdin.
func (*Conn) SetWriteDeadline ¶
SetWriteDeadline sets the deadline on stdout.