1
0
mirror of https://github.com/golang/go synced 2024-11-24 08:50:14 -07:00
go/api/next/54136.txt
Damien Neil fd0c0db4a4 net/http: add ResponseController and per-handler timeouts
The ResponseController type provides a discoverable interface
to optional methods implemented by ResponseWriters.

	c := http.NewResponseController(w)
	c.Flush()

vs.

	if f, ok := w.(http.Flusher); ok {
		f.Flush()
	}

Add the ability to control per-request read and write deadlines
via the ResponseController SetReadDeadline and SetWriteDeadline
methods.

For #54136

Change-Id: I3f97de60d4c9ff150cda559ef86c6620eee665d2
Reviewed-on: https://go-review.googlesource.com/c/go/+/436890
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
2022-11-10 18:18:03 +00:00

7 lines
463 B
Plaintext

pkg net/http, func NewResponseController(ResponseWriter) *ResponseController #54136
pkg net/http, method (*ResponseController) Flush() error #54136
pkg net/http, method (*ResponseController) Hijack() (net.Conn, *bufio.ReadWriter, error) #54136
pkg net/http, method (*ResponseController) SetReadDeadline(time.Time) error #54136
pkg net/http, method (*ResponseController) SetWriteDeadline(time.Time) error #54136
pkg net/http, type ResponseController struct #54136