Documentation ¶
Index ¶
- func HTML(body string) http.Handler
- func JSON(props interface{}) http.Handler
- func RedirectPath(r *http.Request, subpath string) string
- type Format
- type Response
- func (res *Response) HTML(body string) http.Handler
- func (res *Response) JSON(props interface{}) http.Handler
- func (res *Response) Redirect(path string) http.Handler
- func (res *Response) RedirectBack(fallback string) http.Handler
- func (res *Response) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (res *Response) Set(key, value string) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Format ¶
Format returns different responses depending on the Accepts request header TODO: tighten up the types. Maybe HTML(w, r) & JSON(w, r) interfaces
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response struct
func (*Response) RedirectBack ¶ added in v0.2.0
RedirectBack tries using the referrer to redirect to the previous page. If the referrer isn't set, it uses the fallback path.
Click to show internal directories.
Click to hide internal directories.