You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
616 B
30 lines
616 B
5 years ago
|
// +build go1.8
|
||
|
|
||
|
package handlers
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"net/http"
|
||
|
)
|
||
|
|
||
|
type loggingResponseWriter interface {
|
||
|
commonLoggingResponseWriter
|
||
|
http.Pusher
|
||
|
}
|
||
|
|
||
|
func (l *responseLogger) Push(target string, opts *http.PushOptions) error {
|
||
|
p, ok := l.w.(http.Pusher)
|
||
|
if !ok {
|
||
|
return fmt.Errorf("responseLogger does not implement http.Pusher")
|
||
|
}
|
||
|
return p.Push(target, opts)
|
||
|
}
|
||
|
|
||
|
func (c *compressResponseWriter) Push(target string, opts *http.PushOptions) error {
|
||
|
p, ok := c.ResponseWriter.(http.Pusher)
|
||
|
if !ok {
|
||
|
return fmt.Errorf("compressResponseWriter does not implement http.Pusher")
|
||
|
}
|
||
|
return p.Push(target, opts)
|
||
|
}
|