http response tooling written
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package response
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"ruben/inventory2/internal/site/redirect"
|
||||
)
|
||||
|
||||
type (
|
||||
Response interface {
|
||||
Status(int) Response
|
||||
Redirect(code redirect.Code, to string) Response
|
||||
JSON(any) Response
|
||||
Cookie(http.Cookie) Response
|
||||
|
||||
getStatus() (code int, ok bool)
|
||||
getBody() (body io.ReadCloser, ok bool, err error)
|
||||
getRedirect() (code redirect.Code, to string, ok bool)
|
||||
getCookies() []http.Cookie
|
||||
|
||||
wrap(Response) Response
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user