Documentation
¶
Overview ¶
Package bodyreadhook lets a test fixture synchronize with a provider's HTTP connection reads. Production code never installs hooks; with none installed a socket read costs one atomic load.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeforeRead ¶
BeforeRead notifies installed hooks. It reports whether any hook is installed, so the caller can skip AfterRead's address lookup otherwise.
Types ¶
type Hooks ¶
type Hooks struct {
// BeforeRead runs before the transport reads the socket.
BeforeRead func(local string)
// AfterRead runs after the socket read returns n bytes.
AfterRead func(local string, n int)
}
Hooks observe socket reads on the owned provider transport, keyed by the client connection's local address.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package readbarrier synchronizes a test fixture server with the owned provider transport's socket reads.
|
Package readbarrier synchronizes a test fixture server with the owned provider transport's socket reads. |
Click to show internal directories.
Click to hide internal directories.