28 lines
559 B
Go
28 lines
559 B
Go
package response
|
|
|
|
import (
|
|
"io"
|
|
"net/http"
|
|
|
|
"ruben/inventory2/internal/server/redirect"
|
|
)
|
|
|
|
type (
|
|
Response interface {
|
|
Status(int) Response
|
|
Redirect(code redirect.Code, to string) Response
|
|
Body(io.ReadCloser) Response
|
|
HTML([]byte) 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
|
|
getContentType() (contentType string, ok bool)
|
|
|
|
wrap(Response) Response
|
|
}
|
|
)
|