htmlutils

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorFromString

func ColorFromString(s string) string

ColorFromString returns a CSS color string by hashing the incoming string. Used to visually identify different versions.

func FriendlyTime

func FriendlyTime(t time.Time) string

func FuncMap

func FuncMap() template.FuncMap

func JSONString

func JSONString(v interface{}) (template.JS, error)

func RelativeTime

func RelativeTime(t time.Time) string

Types

type TemplateGroup

type TemplateGroup struct {
	// contains filtered or unexported fields
}

func (*TemplateGroup) GetTemplate

func (g *TemplateGroup) GetTemplate(name string) *template.Template

func (*TemplateGroup) LoadTemplates

func (g *TemplateGroup) LoadTemplates() *template.Template

LoadTemplates loads the templates for our toy server

func (*TemplateGroup) Render

func (g *TemplateGroup) Render(w http.ResponseWriter, name string, context interface{})

func (*TemplateGroup) SetConfig

func (g *TemplateGroup) SetConfig(debug bool)

Jump to

Keyboard shortcuts

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