loginterceptor

package
v2.0.0-alpha.66 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

func (*PrefixInterceptor) Write

func (i *PrefixInterceptor) Write(p []byte) (int, error)

Write implements io.Writer. It writes into an internal pipe which the interceptor goroutine consumes.

Jump to

Keyboard shortcuts

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