Documentation
¶
Overview ¶
Package stream owns producer joining and streaming response I/O.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Channel ¶
func Channel( writer http.ResponseWriter, request *http.Request, values <-chan []byte, done <-chan error, encode func([]byte) []byte, policy Policy, ) error
Channel renews deadlines before commitment and each write, propagating every flush failure after commitment without consuming another value.
func Event ¶
Event frames one SSE value, normalizing CRLF and bare CR to prevent field injection. It retains the final empty data line so EventSource preserves the payload's trailing newline rather than consuming it as framing.
func Sequence ¶
func Sequence( writer http.ResponseWriter, request *http.Request, values iter.Seq2[[]byte, error], encode func([]byte) []byte, policy Policy, ) error
Sequence copies borrowed slices before yield returns. Every started producer is joined, including cleanup, before its panic is re-raised on the caller.
Types ¶
type Policy ¶
type Policy struct {
// Timeout resolves options only after capability checks and producer startup.
Timeout func() time.Duration
// NonFlushable is the public error returned by the legacy capability gate.
NonFlushable error
}
Policy supplies the outer package's error identity and per-call settings.
Click to show internal directories.
Click to hide internal directories.