iox

package
v0.0.0-...-4450389 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipe

type Pipe struct {
	R io.ReadCloser
	W io.WriteCloser
}

`iox.Pipe` wraps the read and write ends of a pipe and provides helper methods to close them once. Example:

pipe, err := iox.WrapPipe3(os.Pipe())
if err != nil {
    return err
}
defer pipe.CloseBoth()
...
// Tell consumer EOF.
if err := pipe.CloseW(); err != nil {
    ...
}

func WrapPipe

func WrapPipe(r io.ReadCloser, w io.WriteCloser) *Pipe

func WrapPipe3

func WrapPipe3(r io.ReadCloser, w io.WriteCloser, err error) (*Pipe, error)

func (*Pipe) CloseBoth

func (p *Pipe) CloseBoth() error

func (*Pipe) CloseR

func (p *Pipe) CloseR() error

func (*Pipe) CloseW

func (p *Pipe) CloseW() error

Jump to

Keyboard shortcuts

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