Documentation ¶
Index ¶
- Constants
- type BufferedCollector
- func (bc *BufferedCollector) AnyReader(ctx context.Context) io.Reader
- func (bc *BufferedCollector) Close() error
- func (bc *BufferedCollector) LogOutput()
- func (bc *BufferedCollector) Start(stdoutPipe, stderrPipe io.ReadCloser) error
- func (bc *BufferedCollector) StderrReader(ctx context.Context) io.Reader
- func (bc *BufferedCollector) StderrWriter() io.Writer
- func (bc *BufferedCollector) StdoutReader(ctx context.Context) io.Reader
- func (bc *BufferedCollector) StdoutWriter() io.Writer
- func (bc *BufferedCollector) Wait()
- type Collector
- type Maker
- type Type
Constants ¶
const ( Stdout Type = 1 Stderr = 2 Any = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedCollector ¶
type BufferedCollector struct {
// contains filtered or unexported fields
}
BufferedCollector collects stdout, stderr, and mixed logs.
func NewBufferedCollector ¶
func NewBufferedCollector(fnd app.Foundation, tid string) *BufferedCollector
NewBufferedCollector initializes and returns a new BufferedCollector.
func (*BufferedCollector) AnyReader ¶
func (bc *BufferedCollector) AnyReader(ctx context.Context) io.Reader
AnyReader returns an io.Reader for the mixed logs in the order they were collected.
func (*BufferedCollector) Close ¶
func (bc *BufferedCollector) Close() error
Close closes all pipes.
func (*BufferedCollector) LogOutput ¶
func (bc *BufferedCollector) LogOutput()
LogOutput logs data of all buffers. It should be used only after closing the collector otherwise races possible.
func (*BufferedCollector) Start ¶
func (bc *BufferedCollector) Start(stdoutPipe, stderrPipe io.ReadCloser) error
Start collects stdout, stderr, and mixed logs from the given command.
func (*BufferedCollector) StderrReader ¶
func (bc *BufferedCollector) StderrReader(ctx context.Context) io.Reader
StderrReader returns an io.Reader for the collected stderr logs.
func (*BufferedCollector) StderrWriter ¶
func (bc *BufferedCollector) StderrWriter() io.Writer
StderrWriter returns a MultiWriter that writes to both stderrBuffer and mixedBuffer
func (*BufferedCollector) StdoutReader ¶
func (bc *BufferedCollector) StdoutReader(ctx context.Context) io.Reader
StdoutReader returns an io.Reader for the collected stdout logs.
func (*BufferedCollector) StdoutWriter ¶
func (bc *BufferedCollector) StdoutWriter() io.Writer
StdoutWriter returns a MultiWriter that writes to both stdoutBuffer and mixedBuffer
func (*BufferedCollector) Wait ¶
func (bc *BufferedCollector) Wait()
Wait blocks until all logs are collected.
type Maker ¶
func CreateMaker ¶
func CreateMaker(fnd app.Foundation) Maker