stdio

package module
v0.0.0-...-086ced8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2021 License: BSD-3-Clause-Clear Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Join

func Join(a io.ReadWriter, b io.ReadWriter) error

Join connects two ReaderWriter interfaces to form a direct connection.

Types

type Addr

type Addr struct {
	// contains filtered or unexported fields
}

Addr implements net.Addr for stdin/stdout.

func (Addr) Network

func (a Addr) Network() string

Network returns the network type as a string.

func (Addr) String

func (a Addr) String() string

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn implements a net.Conn via stdin/stdout.

func DialCommand

func DialCommand(cmd *exec.Cmd) (*Conn, error)

DialCommand wraps the stdio of a subprocess.

func DialStdio

func DialStdio() *Conn

DialStdio connects the current process stdio.

func (*Conn) Close

func (s *Conn) Close() error

Close closes both streams.

func (*Conn) LocalAddr

func (s *Conn) LocalAddr() net.Addr

LocalAddr returns stdio addr.

func (*Conn) Read

func (s *Conn) Read(p []byte) (int, error)

func (*Conn) RemoteAddr

func (s *Conn) RemoteAddr() net.Addr

RemoteAddr returns stdio addr.

func (*Conn) SetDeadline

func (s *Conn) SetDeadline(t time.Time) error

SetDeadline sets the read/write deadline.

func (*Conn) SetReadDeadline

func (s *Conn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the read/write deadline.

func (*Conn) SetWriteDeadline

func (s *Conn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the read/write deadline.

func (*Conn) Write

func (s *Conn) Write(p []byte) (int, error)

type CrlfWriter

type CrlfWriter struct {
	W io.Writer
}

func (*CrlfWriter) Write

func (w *CrlfWriter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL