Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrOpenFile is returned when a named tee destination cannot be opened. ErrOpenFile errs.Const = "tee: cannot open file" // ErrWrite is returned when writing a line to a destination fails. ErrWrite errs.Const = "tee: write failed" )
View Source
const ( // TeeAppend (-a) appends to each named file instead of truncating it. TeeAppend teeAppendFlag = true // TeeTruncate (default) truncates each named file before writing. TeeTruncate teeAppendFlag = false )
Variables ¶
This section is empty.
Functions ¶
func Tee ¶
Tee returns a Command that passes lines through unchanged while writing each line to every named file and io.Writer as a side effect — the Unix tee.
Opts are interpreted by type:
- gloo.File: a path written to on the injected filesystem (truncated, or appended to with TeeAppend).
- io.Writer: registered as an additional side-effect destination.
- io.Reader (and not also a Writer): used as the data source, overriding the upstream input stream. This lets Tee(strings.NewReader("..."), file) act as a self-sourcing pipeline element in examples.
- TeeAppend (-a): append to files instead of truncating them.
- TeeFs: the filesystem File paths resolve against (defaults to OS).
Types ¶
Click to show internal directories.
Click to hide internal directories.