add flusher interface and implementation
This commit is contained in:
parent
8da9de3177
commit
4ead8a4600
5
ron.go
5
ron.go
@ -22,6 +22,7 @@ type (
|
||||
|
||||
responseWriterWrapper struct {
|
||||
http.ResponseWriter
|
||||
http.Flusher
|
||||
headerWritten bool
|
||||
}
|
||||
|
||||
@ -76,6 +77,10 @@ func (w *responseWriterWrapper) Write(b []byte) (int, error) {
|
||||
return w.ResponseWriter.Write(b)
|
||||
}
|
||||
|
||||
func (w *responseWriterWrapper) Flush() {
|
||||
w.ResponseWriter.(http.Flusher).Flush()
|
||||
}
|
||||
|
||||
func defaultEngine() *Engine {
|
||||
return &Engine{
|
||||
mux: http.NewServeMux(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user