installed logger
This commit is contained in:
@@ -59,12 +59,12 @@ func (b bodyRes) Cookie(ck http.Cookie) Response {
|
||||
return Cookie(ck).wrap(b)
|
||||
}
|
||||
|
||||
func (b bodyRes) getStatus() (int, bool) {
|
||||
func (b bodyRes) GetStatus() (int, bool) {
|
||||
if b.res == nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return b.res.getStatus()
|
||||
return b.res.GetStatus()
|
||||
}
|
||||
|
||||
func (b bodyRes) getRedirect() (code redirect.Code, to string, ok bool) {
|
||||
|
||||
@@ -58,12 +58,12 @@ func (c cookieRes) Cookie(ck http.Cookie) Response {
|
||||
return Cookie(ck).wrap(c)
|
||||
}
|
||||
|
||||
func (c cookieRes) getStatus() (int, bool) {
|
||||
func (c cookieRes) GetStatus() (int, bool) {
|
||||
if c.res == nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return c.res.getStatus()
|
||||
return c.res.GetStatus()
|
||||
}
|
||||
|
||||
func (c cookieRes) getRedirect() (code redirect.Code, to string, ok bool) {
|
||||
|
||||
@@ -60,12 +60,12 @@ func (h htmlRes) Cookie(ck http.Cookie) Response {
|
||||
return Cookie(ck).wrap(h)
|
||||
}
|
||||
|
||||
func (h htmlRes) getStatus() (int, bool) {
|
||||
func (h htmlRes) GetStatus() (int, bool) {
|
||||
if h.res == nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return h.res.getStatus()
|
||||
return h.res.GetStatus()
|
||||
}
|
||||
|
||||
func (h htmlRes) getRedirect() (code redirect.Code, to string, ok bool) {
|
||||
|
||||
@@ -61,12 +61,12 @@ func (j jsonRes) Cookie(ck http.Cookie) Response {
|
||||
return Cookie(ck).wrap(j)
|
||||
}
|
||||
|
||||
func (j jsonRes) getStatus() (int, bool) {
|
||||
func (j jsonRes) GetStatus() (int, bool) {
|
||||
if j.res == nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return j.res.getStatus()
|
||||
return j.res.GetStatus()
|
||||
}
|
||||
|
||||
func (j jsonRes) getRedirect() (code redirect.Code, to string, ok bool) {
|
||||
|
||||
@@ -99,12 +99,12 @@ func (r redirectRes) Cookie(ck http.Cookie) Response {
|
||||
return Cookie(ck).wrap(r)
|
||||
}
|
||||
|
||||
func (r redirectRes) getStatus() (int, bool) {
|
||||
func (r redirectRes) GetStatus() (int, bool) {
|
||||
if r.res == nil {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return r.res.getStatus()
|
||||
return r.res.GetStatus()
|
||||
}
|
||||
|
||||
func (r redirectRes) getRedirect() (code redirect.Code, to string, ok bool) {
|
||||
|
||||
@@ -16,7 +16,7 @@ type (
|
||||
JSON(any) Response
|
||||
Cookie(http.Cookie) Response
|
||||
|
||||
getStatus() (code int, ok bool)
|
||||
GetStatus() (code int, ok bool)
|
||||
getBody() (body io.ReadCloser, ok bool, err error)
|
||||
getRedirect() (code redirect.Code, to string, ok bool)
|
||||
getCookies() []http.Cookie
|
||||
|
||||
@@ -60,7 +60,7 @@ func (s statusRes) Cookie(ck http.Cookie) Response {
|
||||
return Cookie(ck).wrap(s)
|
||||
}
|
||||
|
||||
func (s statusRes) getStatus() (int, bool) {
|
||||
func (s statusRes) GetStatus() (int, bool) {
|
||||
return s.code, true
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ func Write(w http.ResponseWriter, r *http.Request, res Response) {
|
||||
return
|
||||
}
|
||||
|
||||
if status, ok := res.getStatus(); ok {
|
||||
if status, ok := res.GetStatus(); ok {
|
||||
w.WriteHeader(status)
|
||||
}
|
||||
if bodySet {
|
||||
|
||||
Reference in New Issue
Block a user