Documentation ¶
Index ¶
- func Add(a, b int) int
- func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData
- func ChangeUnderscoreToSlash(s string) string
- func CreateTemplateCache() (map[string]*template.Template, error)
- func FormatDate(t time.Time, f string) string
- func HumanDate(t time.Time) string
- func Iterate(count int) []int
- func NewRenderer(a *config.AppConfig)
- func StringNumberIterate(s string) []int
- func StringToInt(s string) int
- func Subtract(a, b int) int
- func Template(w http.ResponseWriter, r *http.Request, tmpl 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 adds data for all templates.
func ChangeUnderscoreToSlash ¶
Replace underscore to slash.
func CreateTemplateCache ¶
CreateTemplateCache creates a template cache as a map.
func NewRenderer ¶
NewRenderer sets the config for the template package.
func StringNumberIterate ¶
input number in string will return slice of int.
func Template ¶
func Template(w http.ResponseWriter, r *http.Request, tmpl string, td *models.TemplateData) error
Template renders templates using html/template.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.