http response tooling written

This commit is contained in:
2025-12-30 14:42:04 -07:00
parent 493d15eae8
commit c01d700482
14 changed files with 660 additions and 60 deletions
+24
View File
@@ -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
}
)