wys

package
v0.0.0-...-35cacce Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BasicFunctions = template.FuncMap{

	"inc": func(i int) int {
		return i + 1
	},
	"marshal": func(v interface{}) template.JS {
		a, _ := json.Marshal(v)
		return template.JS(a)
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	FS              embed.FS
	PageLocation    string
	PagePattern     string
	LayoutLocation  string
	LayoutPattern   string
	PartialLocation string
	PartialPattern  string
	FuncMap         template.FuncMap

	InProduction bool
	// contains filtered or unexported fields
}

type TemplateData

type TemplateData struct {
	CSRFToken       string
	StringSlice     []string
	StringMap       map[string]string
	IntMap          map[string]int
	FloatMap        map[string]float32
	Data            map[string]interface{}
	Flash           string
	Warning         string
	Error           string
	IsAuthenticated int
	Title           string
	InfoMsg         string
	WarnMsg         string
	ErrMsg          string
}

type ViewManager

type ViewManager interface {
	Render(w http.ResponseWriter, r *http.Request, tmpl string, data *TemplateData) error
}

func New

func New(cfg *Config) (ViewManager, error)

Jump to

Keyboard shortcuts

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