Documentation ¶
Overview ¶
Package outerr contains types to record/pass system out-err streams.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SystemOutErr = NewStreamOutErr(os.Stdout, os.Stderr)
SystemOutErr is a constant wrapping the standard stdout/stderr streams.
Functions ¶
func NewErrWriter ¶
NewErrWriter provides an io.Writer implementation for writing to the err stream of an OutErr.
func NewOutWriter ¶
NewOutWriter provides an io.Writer implementation for writing to the out stream of an OutErr.
Types ¶
type RecordingOutErr ¶
type RecordingOutErr struct { StreamOutErr // contains filtered or unexported fields }
RecordingOutErr is an OutErr capable of recording and returning its contents.
func NewRecordingOutErr ¶
func NewRecordingOutErr() *RecordingOutErr
NewRecordingOutErr initializes a new RecordingOutErr.
func (*RecordingOutErr) Stderr ¶
func (s *RecordingOutErr) Stderr() []byte
Stderr returns the full recorded stderr contents.
func (*RecordingOutErr) Stdout ¶
func (s *RecordingOutErr) Stdout() []byte
Stdout returns the full recorded stdout contents.
type StreamOutErr ¶
StreamOutErr passes the stdout and stderr to two provided writers.
func NewStreamOutErr ¶
func NewStreamOutErr(out, err io.Writer) *StreamOutErr
NewStreamOutErr creates an OutErr from two Writers.
func (*StreamOutErr) WriteErr ¶
func (s *StreamOutErr) WriteErr(buf []byte)
WriteErr writes the given bytes to stderr.
func (*StreamOutErr) WriteOut ¶
func (s *StreamOutErr) WriteOut(buf []byte)
WriteOut writes the given bytes to stdout.