Documentation ¶
Index ¶
- Variables
- func Content(content interface{}) inter.Response
- func Download(filename string) inter.Response
- func DownloadE(filename string) (inter.Response, error)
- func Html(content interface{}) inter.Response
- func Json(content interface{}) inter.Response
- func Redirect(destination string, status int) inter.Response
- func RedirectPermanent(destination string) inter.Response
- func RedirectTemporary(destination string) inter.Response
- func RedirectToRoute(app inter.App, route string, parameters ...Parameters) inter.Response
- func RouteByName(routes inter.RouteCollection, name string) (inter.Route, error)
- func UrlByName(app inter.App, name string, parameters ...Parameters) string
- type ContentResponse
- type HtmlResponse
- type JsonResponse
- type Options
- type Parameters
- type Response
- func (r Response) App() inter.App
- func (r *Response) Body(body string) inter.Response
- func (r *Response) Content(content interface{})
- func (r *Response) Cookie(cookies ...http.Cookie) inter.Response
- func (r *Response) Filename(filename string) inter.Response
- func (r Response) GetBody() string
- func (r Response) GetBodyE() (string, error)
- func (r *Response) GetContent() interface{}
- func (r Response) GetCookies() []http.Cookie
- func (r Response) GetHeader(key string) string
- func (r Response) GetHeaders() http.Header
- func (r Response) GetStatus() int
- func (r *Response) Header(key string, values ...string) inter.Response
- func (r *Response) Headers(headers http.Header) inter.Response
- func (r *Response) SetApp(app inter.App)
- func (r *Response) ShowInBrowser() inter.Response
- func (r *Response) Status(status int) inter.Response
Constants ¶
This section is empty.
Variables ¶
View Source
var CanNotDownloadDirectoryError = FileNotFoundError
View Source
var FileNotFoundError = errors.New("file not found").Status(net.StatusNotFound)
Functions ¶
func RedirectPermanent ¶
Create a permanent redirect from one URI to another.
func RedirectTemporary ¶
Create a temporary redirect from one URI to another.
func RedirectToRoute ¶
Redirect to route by route name
func RouteByName ¶
Receive inter.Route by name
Types ¶
type ContentResponse ¶
type ContentResponse struct {
*Response
}
type HtmlResponse ¶
type HtmlResponse struct {
*Response
}
type JsonResponse ¶
type JsonResponse struct {
*Response
}
type Parameters ¶
type Parameters map[string]interface{}
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
func NewResponse ¶
func (*Response) Content ¶
func (r *Response) Content(content interface{})
Put the raw content. "response_decorators" are responsible for converting the content into a body
func (*Response) GetContent ¶
func (r *Response) GetContent() interface{}
Receive the raw content. Only available before it has been converted to a body (by "response_decorators")
func (Response) GetCookies ¶
func (Response) GetHeaders ¶
func (*Response) ShowInBrowser ¶
Click to show internal directories.
Click to hide internal directories.