Versions in this module Expand all Collapse all v1 v1.5.0 Nov 16, 2021 Changes in this version + var FinishEarly = errors.New("finish stage early") + var IsEPIPE = IsError(syscall.EPIPE) + var IsErrClosedPipe = IsError(io.ErrClosedPipe) + var IsPipeError = AnyError(IsSIGPIPE, IsEPIPE, IsErrClosedPipe) + var IsSIGPIPE = IsSignal(syscall.SIGPIPE) + func ScanLFTerminatedLines(data []byte, atEOF bool) (advance int, token []byte, err error) + type Env struct + Dir string + type ErrorFilter func(err error) error + type ErrorMatcher func(err error) bool + func AnyError(ems ...ErrorMatcher) ErrorMatcher + func IsError(target error) ErrorMatcher + func IsSignal(signal syscall.Signal) ErrorMatcher + type LinewiseStageFunc func(ctx context.Context, env Env, line []byte, stdout *bufio.Writer) error + type NewScannerFunc func(r io.Reader) (Scanner, error) + type Option func(*Pipeline) + func WithDir(dir string) Option + func WithStdin(stdin io.Reader) Option + func WithStdout(stdout io.Writer) Option + func WithStdoutCloser(stdout io.WriteCloser) Option + type Pipeline struct + func New(options ...Option) *Pipeline + func (p *Pipeline) Add(stages ...Stage) + func (p *Pipeline) AddWithIgnoredError(em ErrorMatcher, stages ...Stage) + func (p *Pipeline) Output(ctx context.Context) ([]byte, error) + func (p *Pipeline) Run(ctx context.Context) error + func (p *Pipeline) Start(ctx context.Context) error + func (p *Pipeline) Wait() error + type Scanner interface + Bytes func() []byte + Err func() error + Scan func() bool + type Stage interface + Name func() string + Start func(ctx context.Context, env Env, stdin io.ReadCloser) (io.ReadCloser, error) + Wait func() error + func Command(command string, args ...string) Stage + func CommandStage(name string, cmd *exec.Cmd) Stage + func FilterError(s Stage, filter ErrorFilter) Stage + func Function(name string, f StageFunc) Stage + func IgnoreError(s Stage, em ErrorMatcher) Stage + func LinewiseFunction(name string, f LinewiseStageFunc) Stage + func Print(a ...interface{}) Stage + func Printf(format string, a ...interface{}) Stage + func Println(a ...interface{}) Stage + func ScannerFunction(name string, newScanner NewScannerFunc, f LinewiseStageFunc) Stage + type StageFunc func(ctx context.Context, env Env, stdin io.Reader, stdout io.Writer) error