Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PipeWiring ¶
type PipeWiring struct {
XcbuildRawout *bytes.Buffer
XcbuildStdout io.Writer
XcbuildStderr io.Writer
ToolStdin io.ReadCloser
ToolStdout io.WriteCloser
ToolStderr io.WriteCloser
// contains filtered or unexported fields
}
PipeWiring is a helper struct to define the setup and binding of tools and xcbuild with a filter and stdout. It is purely boilerplate reduction and it is the users responsibility to choose between this and manual hooking of the in/outputs. It also provides a convenient Close() method that only closes things that can/should be closed.
func SetupPipeWiring ¶
func SetupPipeWiring(filter *regexp.Regexp) *PipeWiring
SetupPipeWiring creates a new PipeWiring instance that contains the usual input/outputs that an xcodebuild command and a logging tool needs when we are also using a logging filter.
func (*PipeWiring) CloseFilter ¶
func (p *PipeWiring) CloseFilter() error
CloseFilter closes the filter and waits for it to finish
type PrefixFilter ¶
type PrefixFilter struct {
Matching *Sink
Filtered io.Writer
// contains filtered or unexported fields
}
PrefixFilter intercept writes: when the message has a prefix that matches a regexp it writes into the `Matching` sink, otherwise to the `Filtered` sink.
Note: Callers are responsible for closing `Matching` and `Filtered` Sinks
func NewPrefixFilter ¶
NewPrefixFilter returns a new PrefixFilter. Writes are based on line prefix.
Note: Callers are responsible for closing intercepted and target writers that implement io.Closer
func (*PrefixFilter) Close ¶
func (p *PrefixFilter) Close() error
Close stops the interceptor and closes the pipe.
func (*PrefixFilter) Done ¶
func (p *PrefixFilter) Done() <-chan struct{}
Done returns a channel on which the user can observe when the last messages are written to the outputs. The channel has a buffer of one to prevent early unreceived messages or late subscriptions to the channel.
func (*PrefixFilter) MessageLost ¶
func (p *PrefixFilter) MessageLost() <-chan error
MessageLost returns a channel on which the user can observe if there were messages lost. The channel has a buffer of one to prevent early unreceived messages or late subscriptions to the channel.
func (*PrefixFilter) ScannerError ¶
func (p *PrefixFilter) ScannerError() <-chan error
ScannerError returns a channel on which the user can observe if there were any scanner errors. The channel has a buffer of one to prevent early unreceived messages or late subscriptions to the channel.
type Sink ¶
type Sink struct {
io.WriteCloser
// contains filtered or unexported fields
}
Sink is an io.WriteCloser that uses a bufio.Writer to wrap the downstream and default buffer sizes and the regular flushing of the buffer for convenience.