Skip to content
Myr

gin.responseWriter implements http.Flusher and http.CloseNotifier

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Manu Mtz-Almeida · committed by Manu Mtz-Almeida · parent 7a87c5c · Browse files · 1 file+16 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+16 added−0 removed

  • other:+16 added−0 removed

1 file+16 added−0 removed

modified:response_writer.go+16 added
10 unmodified lines
11type (12 ResponseWriter interface {13 http.ResponseWriter14 http.Hijacker15 http.Flusher16 http.CloseNotifier1718 Status() int19 Written() bool20 WriteHeaderNow()21 }
47 unmodified lines
69 return nil, nil, errors.New("the ResponseWriter doesn't support the Hijacker interface")70 }71 return hijacker.Hijack()72}7374// Implements the http.CloseNotify interface75func (w *responseWriter) CloseNotify() <-chan bool {76 return w.ResponseWriter.(http.CloseNotifier).CloseNotify()77}7879// Implements the http.Flush interface80func (w *responseWriter) Flush() {81 flusher, ok := w.ResponseWriter.(http.Flusher)82 if ok {83 flusher.Flush()84 }85}