Documentation
¶
Index ¶
- type AccountHandler
- type AdminDashboardHandler
- type AdminHandler
- type AdminReportsHandler
- type AdminRolesHandler
- type AdminSecurityHandler
- type AdminUsersHandler
- type Breadcrumb
- type Frontend
- type HTMLResponse
- type HTMLResponseParams
- type HTTPErrorHandlerTemplate
- type HomepageHandler
- type LoginForm
- type LoginHandler
- type LogoutHandler
- type ProductHandler
- type Router
- type SearchHandler
- type StaticHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountHandler ¶
type AccountHandler struct {
Frontend *Frontend
}
AccountHandler for the application.
func (*AccountHandler) ServeHTTP ¶
func (h *AccountHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AdminDashboardHandler ¶
type AdminDashboardHandler struct {
Frontend *Frontend
}
AdminDashboardHandler for the application.
func (*AdminDashboardHandler) ServeHTTP ¶
func (h *AdminDashboardHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
DashboardHandler for /admin.
type AdminHandler ¶
type AdminHandler struct { Frontend *Frontend // contains filtered or unexported fields }
AdminHandler for the application.
func (*AdminHandler) ServeHTTP ¶
func (h *AdminHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type AdminReportsHandler ¶
type AdminReportsHandler struct {
Frontend *Frontend
}
AdminReportsHandler for the application.
func (*AdminReportsHandler) ServeHTTP ¶
func (h *AdminReportsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
UsersHandler for /admin/reports.
type AdminRolesHandler ¶
type AdminRolesHandler struct {
Frontend *Frontend
}
AdminRolesHandler for the application.
func (*AdminRolesHandler) ServeHTTP ¶
func (h *AdminRolesHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
UsersHandler for /admin/roles.
type AdminSecurityHandler ¶
type AdminSecurityHandler struct {
Frontend *Frontend
}
AdminSecurityHandler for the application.
func (*AdminSecurityHandler) ServeHTTP ¶
func (h *AdminSecurityHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
UsersHandler for /admin/security.
type AdminUsersHandler ¶
type AdminUsersHandler struct {
Frontend *Frontend
}
AdminUsersHandler for the application.
func (*AdminUsersHandler) ServeHTTP ¶
func (h *AdminUsersHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
UsersHandler for /admin/users.
type Breadcrumb ¶
Breadcrumb shows where the user is currently.
type Frontend ¶
Frontend helpers.
func (*Frontend) Respond ¶
func (f *Frontend) Respond(w http.ResponseWriter, r *http.Request, resp *HTMLResponse)
Respond HTML to the browser.
NOTE(henvic): Regarding why we need to use a second template execution when printing with the layout, please see: https://groups.google.com/d/msg/golang-nuts/PRLloHrJrDU/lDYA6Pq_l8QJ https://stackoverflow.com/questions/28830543/how-to-use-a-field-of-struct-or-variable-value-as-template-name/28831138#28831138
type HTMLResponse ¶
type HTMLResponse struct { Template string Title string CanonicalLink string Breadcrumb []Breadcrumb Content interface{} SkipLayout bool Params *HTMLResponseParams }
HTMLResponse to send to the client.
type HTMLResponseParams ¶
type HTMLResponseParams struct { Settings *config.Settings CSRFField template.HTML Request *http.Request User *services.User }
HTMLResponseParams injected into the template object.
type HTTPErrorHandlerTemplate ¶
HTTPErrorHandlerTemplate to use when rendering 'Internal Server Error' pages and the like.
type HomepageHandler ¶
type HomepageHandler struct {
Frontend *Frontend
}
HomepageHandler handles the / page.
func (*HomepageHandler) ServeHTTP ¶
func (h *HomepageHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LoginHandler ¶
type LoginHandler struct {
Frontend *Frontend
}
LoginHandler handles the user authentication.
func (*LoginHandler) ServeHTTP ¶
func (h *LoginHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type LogoutHandler ¶
type LogoutHandler struct {
Frontend *Frontend
}
LogoutHandler manages the logout endpoint.
func (*LogoutHandler) ServeHTTP ¶
func (h *LogoutHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ProductHandler ¶
type ProductHandler struct {
Frontend *Frontend
}
ProductHandler for the application.
func (*ProductHandler) ServeHTTP ¶
func (h *ProductHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Router ¶
type Router struct { Frontend *Frontend // contains filtered or unexported fields }
Router for the webpages.
type SearchHandler ¶
type SearchHandler struct {
Frontend *Frontend
}
SearchHandler for the application.
func (*SearchHandler) ServeHTTP ¶
func (h *SearchHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type StaticHandler ¶
type StaticHandler struct {
Frontend *Frontend
}
StaticHandler checks permission to see if the user is able to access static content, and serve them. This is useful to provide files such as favicon.ico, or other stuff that aren't supposed to be stored in the CDN.
func (*StaticHandler) ServeHTTP ¶
func (h *StaticHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)