command

package module
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 5 Imported by: 0

README

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Emit

func Emit(opts ...any) gloo.Source[[]byte]

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 EmitStderr

type EmitStderr string

EmitStderr sets content written to the stderr destination.

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.

Jump to

Keyboard shortcuts

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