Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosed = errors.New("reader closed") ErrBlocked = errors.New("blocked string match found in stream") )
View Source
var (
ErrMatcherBufferFull = errors.New("matcher buffer full")
)
Functions ¶
func InspectReader ¶
func InspectReader(ctx context.Context, bo BufferOptions, f func([]byte) (int, error), rc io.ReadCloser) io.ReadCloser
InspectReader wraps the given ReadCloser such that the given function f can inspect the streaming while streaming to the target. A target can be any io.ReadCloser, so for example the request body to the backend or the response body to the client. InspectReader applies given BufferOptions to the matcher.
NOTE: This function is *experimental* and will likely change or disappear in the future.
Types ¶
type BufferOptions ¶
type BufferOptions struct { MaxBufferHandling MaxBufferHandling ReadBufferSize uint64 }
type MaxBufferHandling ¶
type MaxBufferHandling int
const ( MaxBufferBestEffort MaxBufferHandling = iota MaxBufferAbort )
Click to show internal directories.
Click to hide internal directories.