Documentation ¶
Index ¶
- func Add(a, b int) int
- func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData
- func CreateTemplateCache() (map[string]*template.Template, error)
- func FormatDate(t time.Time, f string) string
- func HumanReadableDate(t time.Time) string
- func Iterate(count int) []int
- func NewRenderer(a *config.AppConfig)
- func Template(w http.ResponseWriter, r *http.Request, tpml string, td *models.TemplateData) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddDefaultData ¶
func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData
AddDefaultData contains Data which will be added to data sent to templates
func CreateTemplateCache ¶
CreateTemplateCache creates a map and stores the tempales in for caching.
func FormatDate ¶ added in v1.0.160
FormatDate returns a string of a time formatted as demanded
func HumanReadableDate ¶ added in v1.0.151
HumanReadableDate returns a time value in the YYYY-MM-DD format
func Iterate ¶ added in v1.0.160
Iterate creates and returns a slice of ints, starting at 1, going to count
func NewRenderer ¶ added in v1.0.107
NewRenderer sets the config for the template package
func Template ¶ added in v1.0.107
func Template(w http.ResponseWriter, r *http.Request, tpml string, td *models.TemplateData) error
Template serves as a wrapper and renders a layout and a template from folder /templates to a desired writer
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.