view

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine renders the view template.

func NewEngine

func NewEngine(asset *support.Asset, config *support.Config, logger *support.Logger) *Engine

NewEngine initializes the view engine instance.

func (*Engine) HTMLSet

func (e *Engine) HTMLSet() *jet.Set

HTMLSet returns the template set in which the contents are escaped by template.HTMLEscape.

func (*Engine) SetGlobalFuncs

func (e *Engine) SetGlobalFuncs(viewFuncs map[string]interface{})

SetGlobalFuncs set up the global functions by combining built-in and application functions.

func (*Engine) TxtSet

func (e *Engine) TxtSet() *jet.Set

TxtSet returns the template set in which the contents are plain text without being escaped.

type Loader

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

Loader is used to load template content.

func NewLoader

func NewLoader(asset *support.Asset) *Loader

NewLoader initializes the ViewLoader instance.

func (*Loader) Exists

func (l *Loader) Exists(filename string) (string, bool)

Exists checks for template existence and returns full path.

func (*Loader) Open

func (l *Loader) Open(filename string) (io.ReadCloser, error)

Open opens the underlying reader with template content.

Jump to

Keyboard shortcuts

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