25 lines
453 B
Go
25 lines
453 B
Go
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
|
|
}
|
|
)
|