diff options
| author | Damien Neil <dneil@google.com> | 2022-07-29 09:27:16 -0700 |
|---|---|---|
| committer | Damien Neil <dneil@google.com> | 2022-11-10 18:18:03 +0000 |
| commit | fd0c0db4a411eae0483d1cb141e801af401e43d3 (patch) | |
| tree | 6a6103a8bcf17cf13b7e583bcccb6d7056316c81 /api/next | |
| parent | 94b03081f43996aa778829596adb7f43d8644308 (diff) | |
| download | go-fd0c0db4a411eae0483d1cb141e801af401e43d3.tar.xz | |
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>
Diffstat (limited to 'api/next')
| -rw-r--r-- | api/next/54136.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/next/54136.txt b/api/next/54136.txt new file mode 100644 index 0000000000..feeba39d8d --- /dev/null +++ b/api/next/54136.txt @@ -0,0 +1,6 @@ +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 |
