Documentation ¶
Index ¶
- func DateAfterY1(t time.Time) bool
- func DefaultData(td templates.TemplateData, r *http.Request, w http.ResponseWriter) templates.TemplateData
- func FormatDateWithLayout(t time.Time, f string) string
- func HumanDate(t time.Time) string
- func IsAuthenticated(r *http.Request) bool
- func NewHelpers(a *config.AppConfig)
- func RandomString(n int) string
- func RenderPage(w http.ResponseWriter, r *http.Request, templateName string, ...) error
- func SendEmail(mailMessage channeldata.MailData)
- func ServerError(w http.ResponseWriter, r *http.Request, err error)
- func SetViews(path string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DateAfterY1 ¶
DateAfterY1 is used to verify that a date is after the year 1 (since go hates nulls)
func DefaultData ¶
func DefaultData(td templates.TemplateData, r *http.Request, w http.ResponseWriter) templates.TemplateData
DefaultData adds default data which is accessible to all templates
func FormatDateWithLayout ¶
FormatDateWithLayout formats a time with provided (go compliant) format string, and returns it as a string
func IsAuthenticated ¶
IsAuthenticated returns true if a user is authenticated
func RandomString ¶
RandomString returns a random string of letters of length n
func RenderPage ¶
func RenderPage(w http.ResponseWriter, r *http.Request, templateName string, variables, data interface{}) error
RenderPage renders a page using jet templates
func ServerError ¶
func ServerError(w http.ResponseWriter, r *http.Request, err error)
ServerError will display error page for internal server error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.