Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Emit ¶
Emit returns a Source that emits fixed content. The stdout content is split on newlines and emitted as the output stream; optional stderr content is written to a stderr destination (os.Stderr by default) as a side effect when the source runs. It is handy for seeding and testing pipelines.
Call shapes:
Emit("line1\nline2") // stdout only
Emit("out", EmitStderr("warning")) // stdout + stderr
Emit("out", EmitStderr("warning"), EmitStderrTo(&buf)) // capture stderr
Types ¶
type EmitStderrDest ¶
type EmitStderrDest struct {
// contains filtered or unexported fields
}
EmitStderrDest overrides where stderr content is written (default os.Stderr).
func EmitStderrTo ¶
func EmitStderrTo(w io.Writer) EmitStderrDest
EmitStderrTo redirects emitted stderr content to w. Useful in tests.
type EmitStdout ¶
type EmitStdout string
EmitStdout sets the stdout content. A bare string passed to Emit is treated the same way; this typed form is for disambiguation.
Click to show internal directories.
Click to hide internal directories.