1 Star 0 Fork 0

hh/iris

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
response.go 1.08 KB
Copy Edit Raw Blame History
package entry
import "net/http"
// Response is the cached response will be send to the clients
// its fields setted at runtime on each of the non-cached executions
// non-cached executions = first execution, and each time after
// cache expiration datetime passed.
type Response struct {
// statusCode for the response cache handler.
statusCode int
// body is the contents will be served by the cache handler.
body []byte
// the total headers of the response, including content type.
headers http.Header
}
// StatusCode returns a valid status code.
func (r *Response) StatusCode() int {
if r.statusCode <= 0 {
r.statusCode = 200
}
return r.statusCode
}
// ContentType returns a valid content type
// func (r *Response) ContentType() string {
// if r.headers == "" {
// r.contentType = "text/html; charset=utf-8"
// }
// return r.contentType
// }
// Headers returns the total headers of the cached response.
func (r *Response) Headers() http.Header {
return r.headers
}
// Body returns contents will be served by the cache handler.
func (r *Response) Body() []byte {
return r.body
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/w1229748769/iris.git
git@gitee.com:w1229748769/iris.git
w1229748769
iris
iris
v10.2.1

Search