mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 10:02:10 +08:00
chore: ResponseWriter rename responseWriterBase
This commit is contained in:
parent
28a6d2bbf6
commit
8ed5d8bd3d
@ -16,6 +16,29 @@ const (
|
|||||||
defaultStatus = 200
|
defaultStatus = 200
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type responseWriterBase interface {
|
||||||
|
http.ResponseWriter
|
||||||
|
http.Hijacker
|
||||||
|
http.Flusher
|
||||||
|
http.CloseNotifier
|
||||||
|
|
||||||
|
// Returns the HTTP response status code of the current request.
|
||||||
|
Status() int
|
||||||
|
|
||||||
|
// Returns the number of bytes already written into the response http body.
|
||||||
|
// See Written()
|
||||||
|
Size() int
|
||||||
|
|
||||||
|
// Writes the string into the response body.
|
||||||
|
WriteString(string) (int, error)
|
||||||
|
|
||||||
|
// Returns true if the response body was already written.
|
||||||
|
Written() bool
|
||||||
|
|
||||||
|
// Forces to write the http header (status code + headers).
|
||||||
|
WriteHeaderNow()
|
||||||
|
}
|
||||||
|
|
||||||
type responseWriter struct {
|
type responseWriter struct {
|
||||||
http.ResponseWriter
|
http.ResponseWriter
|
||||||
size int
|
size int
|
||||||
|
@ -6,28 +6,7 @@
|
|||||||
|
|
||||||
package gin
|
package gin
|
||||||
|
|
||||||
import "net/http"
|
|
||||||
|
|
||||||
// ResponseWriter ...
|
// ResponseWriter ...
|
||||||
type ResponseWriter interface {
|
type ResponseWriter interface {
|
||||||
http.ResponseWriter
|
responseWriterBase
|
||||||
http.Hijacker
|
|
||||||
http.Flusher
|
|
||||||
http.CloseNotifier
|
|
||||||
|
|
||||||
// Returns the HTTP response status code of the current request.
|
|
||||||
Status() int
|
|
||||||
|
|
||||||
// Returns the number of bytes already written into the response http body.
|
|
||||||
// See Written()
|
|
||||||
Size() int
|
|
||||||
|
|
||||||
// Writes the string into the response body.
|
|
||||||
WriteString(string) (int, error)
|
|
||||||
|
|
||||||
// Returns true if the response body was already written.
|
|
||||||
Written() bool
|
|
||||||
|
|
||||||
// Forces to write the http header (status code + headers).
|
|
||||||
WriteHeaderNow()
|
|
||||||
}
|
}
|
||||||
|
@ -12,27 +12,7 @@ import (
|
|||||||
|
|
||||||
// ResponseWriter ...
|
// ResponseWriter ...
|
||||||
type ResponseWriter interface {
|
type ResponseWriter interface {
|
||||||
http.ResponseWriter
|
responseWriterBase
|
||||||
http.Hijacker
|
|
||||||
http.Flusher
|
|
||||||
http.CloseNotifier
|
|
||||||
|
|
||||||
// Returns the HTTP response status code of the current request.
|
|
||||||
Status() int
|
|
||||||
|
|
||||||
// Returns the number of bytes already written into the response http body.
|
|
||||||
// See Written()
|
|
||||||
Size() int
|
|
||||||
|
|
||||||
// Writes the string into the response body.
|
|
||||||
WriteString(string) (int, error)
|
|
||||||
|
|
||||||
// Returns true if the response body was already written.
|
|
||||||
Written() bool
|
|
||||||
|
|
||||||
// Forces to write the http header (status code + headers).
|
|
||||||
WriteHeaderNow()
|
|
||||||
|
|
||||||
// get the http.Pusher for server push
|
// get the http.Pusher for server push
|
||||||
Pusher() http.Pusher
|
Pusher() http.Pusher
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user