Documentation
¶
Overview ¶
Package ownedstream retains a borrowed stream until reads and close actually return. It is used by both sides of one outbound HTTP transport attempt.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Body ¶
type Body struct {
// contains filtered or unexported fields
}
func New ¶
func New(ctx context.Context, source io.ReadCloser, maximum, expected int64, tap *httpcapture.Tap) (*Body, error)
New owns source until Close. tap, when not nil, observes every returned byte and how the stream ended; it never changes what a reader receives.
func (*Body) Close ¶
Close interrupts a read using the underlying io.ReadCloser contract, then waits for that read's actual exit. It never holds readMu while closing source.
func (*Body) Err ¶
Err includes a swallowed read failure after a custom transport/callback returns. A normal EOF is not a failure.
Click to show internal directories.
Click to hide internal directories.