Documentation
¶
Overview ¶
Package capture streams HTTP bodies into the store as they pass through, without buffering them in memory.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capturer ¶
type Capturer struct {
// contains filtered or unexported fields
}
Capturer creates body-capturing tees backed by a Store.
func (*Capturer) TagIfAuth ¶ added in v0.13.0
TagIfAuth calls st.AddFlowTags(id, ["auth"]) when the given path looks like an auth endpoint. The call is best-effort: any error is silently ignored so the capture/forwarding path is never affected. It is safe to call concurrently and is a no-op when path does not match.
func (*Capturer) TeeBody ¶
func (c *Capturer) TeeBody(src io.Reader) (r io.Reader, finalize func() (string, int64, error), err error)
TeeBody wraps src so that every byte read from the returned reader is also written to the store. Call finalize after the reader is fully consumed to commit the body and obtain its hash and length. If src is nil, the returned reader is empty and finalize reports an empty body.