render

package
v0.0.0-...-7b3d061 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 5, 2024 License: GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a, b int) int

Add adds beetwen two number.

func AddDefaultData

func AddDefaultData(td *models.TemplateData, r *http.Request) *models.TemplateData

AddDefaultData adds data for all templates.

func ChangeUnderscoreToSlash

func ChangeUnderscoreToSlash(s string) string

Replace underscore to slash.

func CreateTemplateCache

func CreateTemplateCache() (map[string]*template.Template, error)

CreateTemplateCache creates a template cache as a map.

func FormatDate

func FormatDate(t time.Time, f string) string

FormatDate returns formatted date.

func HumanDate

func HumanDate(t time.Time) string

HumanDate returns time in YYYY-mm-dd.

func Iterate

func Iterate(count int) []int

Iterate returns a slice of ints, starting at 1, going to count.

func NewRenderer

func NewRenderer(a *config.AppConfig)

NewRenderer sets the config for the template package.

func StringNumberIterate

func StringNumberIterate(s string) []int

input number in string will return slice of int.

func StringToInt

func StringToInt(s string) int

Convert string to int.

func Subtract

func Subtract(a, b int) int

Subtract beetwen two number.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL