Documentation
¶
Index ¶
- func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData
- func CreateTemplateCache() (map[string]*template.Template, error)
- func HumanDate(t time.Time) string
- func IsAvailable(name string, data interface{}) bool
- func IsInt(i interface{}) bool
- func IsString(i interface{}) bool
- func NewRenderer(a *config.AppConfig)
- 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 creates default models.TemplateData which should be accessable to each template when rendered.
func CreateTemplateCache ¶
CreateTemplateCache creates a Template Cache map[string]*tempalte.Template{} which stores all application templates in memory and makes them easier to load; loading from internal memory is faster then loading from disk each time.
func IsAvailable ¶
IsAvailable checks whether or not struct field is available
func IsString ¶
func IsString(i interface{}) bool
IsString returns true if argument is of type string
func NewRenderer ¶
NewRenderer sets the config for the template package
func Template ¶
func Template(w http.ResponseWriter, r *http.Request, tmpl string, td *models.TemplateData) error
Template renders template using html/template package.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.