command

package module
v0.1.22 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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

func Tee(opts ...any) gloo.Command[[]byte, []byte]

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

type TeeFs

type TeeFs struct{ afero.Fs }

TeeFs injects the filesystem tee writes named File arguments to. It defaults to the OS filesystem; tests supply afero.NewMemMapFs().

Directories

Path Synopsis
Package alias provides unprefixed names for the tee command surface.
Package alias provides unprefixed names for the tee command surface.

Jump to

Keyboard shortcuts

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