1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-20 03:17:04 +00:00

doc: minor

Former-commit-id: 649e2d673a834625d5f3e8703533ad1db2553aec
This commit is contained in:
Gerasimos (Makis) Maropoulos
2020-07-19 10:26:59 +03:00
parent c18106166b
commit 3faaf954bb
8 changed files with 20 additions and 10 deletions

View File

@@ -24,11 +24,12 @@ type ResponseWriter interface {
// Naive returns the simple, underline and original http.ResponseWriter
// that backends this response writer.
Naive() http.ResponseWriter
// SetWriter sets the underline http.ResponseWriter
// that this responseWriter should write on.
SetWriter(underline http.ResponseWriter)
// BeginResponse receives an http.ResponseWriter
// and initialize or reset the response writer's field's values.
BeginResponse(http.ResponseWriter)
// EndResponse is the last function which is called right before the server sent the final response.
//
// Here is the place which we can make the last checks or do a cleanup.
@@ -168,6 +169,12 @@ func (w *responseWriter) BeginResponse(underline http.ResponseWriter) {
w.beforeFlush = nil
w.written = NoWritten
w.statusCode = defaultStatusCode
w.SetWriter(underline)
}
// SetWriter sets the underline http.ResponseWriter
// that this responseWriter should write on.
func (w *responseWriter) SetWriter(underline http.ResponseWriter) {
w.ResponseWriter = underline
pusher, ok := underline.(http.Pusher)