pongo2

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

func AutoReload

func AutoReload(autoReload bool) Option

AutoReload - Template directory.

func Ext

func Ext(ext string) Option

Ext - Template extension. Default=.html

func TemplateDir

func TemplateDir(templateDir string) Option

TemplateDir - Template directory. Default=templates

type Options

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

type Pongo2Engine

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

A Pongo2Engine implements keeper, loader and reloader for HTML templates

func NewPongo2Engine

func NewPongo2Engine(opts ...Option) (tmpl *Pongo2Engine)

func (*Pongo2Engine) Init

func (e *Pongo2Engine) Init() error

func (*Pongo2Engine) IsModified

func (t *Pongo2Engine) IsModified() (yep bool, err error)

IsModified lookups directory for changes to reload (or not to reload) templates if autoReloadopment pin is true.

func (*Pongo2Engine) Load

func (t *Pongo2Engine) Load() (err error)

Load or reload templates

func (*Pongo2Engine) Render

func (t *Pongo2Engine) Render(w http.ResponseWriter, status int, name string, d *sync.Map) (err error)

Jump to

Keyboard shortcuts

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