Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NonBlockingWriter ¶
type NonBlockingWriter struct {
// contains filtered or unexported fields
}
NonBlockingWriter is an io.Writer that writes to a wrapped io.Writer in a non-blocking way.
func NewNonBlockingWriter ¶
func NewNonBlockingWriter(w io.Writer, logger log.Logger) *NonBlockingWriter
NewNonBlockingWriter creates a new NonBlockingWriter.
func (*NonBlockingWriter) Close ¶
func (i *NonBlockingWriter) Close() error
Close stops the interceptor and closes the pipe.
func (*NonBlockingWriter) Run ¶
func (i *NonBlockingWriter) Run()
Run consumes the channel and writes to the wrapped writer.
type PrefixInterceptor ¶
type PrefixInterceptor struct {
// contains filtered or unexported fields
}
PrefixInterceptor intercept writes: if a line begins with prefix, it will be written to both writers. Partial writes without newline are buffered until a newline.
func NewPrefixInterceptor ¶
func NewPrefixInterceptor(prefixRegexp *regexp.Regexp, intercepted, target io.Writer, logger log.Logger) *PrefixInterceptor
NewPrefixInterceptor returns an io.WriteCloser. Writes are based on line prefix.
func (*PrefixInterceptor) Close ¶
func (i *PrefixInterceptor) Close() error
Close stops the interceptor and closes the pipe.
Click to show internal directories.
Click to hide internal directories.