Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions response.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package echo

import (
"bufio"
"log"
"net"
"net/http"

"github.com/labstack/gommon/color"
Expand Down Expand Up @@ -37,6 +39,21 @@ func (r *Response) Write(b []byte) (n int, err error) {
return n, err
}

// Flush wraps response writer's Flush function.
func (r *Response) Flush() {
r.Writer.(http.Flusher).Flush()
}

// Hijack wraps response writer's Hijack function.
func (r *Response) Hijack() (net.Conn, *bufio.ReadWriter, error) {
return r.Writer.(http.Hijacker).Hijack()
}

// CloseNotify wraps response writer's CloseNotify function.
func (r *Response) CloseNotify() <-chan bool {
return r.Writer.(http.CloseNotifier).CloseNotify()
}

func (r *Response) Status() int {
return r.status
}
Expand All @@ -47,5 +64,6 @@ func (r *Response) Size() int64 {

func (r *Response) reset(w http.ResponseWriter) {
r.Writer = w
r.status = http.StatusOK
r.committed = false
}