jetfiber

package module
v1.3.1 Latest Latest
Warning

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

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

README

gofiber-template-jet

A jet v5 template for gofiber

Third-party library licenses

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Directory   string
	Extension   string
	Development bool
	HTTPFileSys http.FileSystem
}

Config struct

type Engine

type Engine struct {
	Templates *jet.Set
	// contains filtered or unexported fields
}

Engine struct

func Init

func Init(config ...Config) *Engine

Init returns Engine struct

func (*Engine) AddFastFunc added in v1.2.0

func (e *Engine) AddFastFunc(name string, fn jet.Func) *Engine

AddFastFunc adds a Jet fast function Signature: func(jet.Arguments) reflect.Value

func (*Engine) AddFunc

func (e *Engine) AddFunc(name string, fn interface{}) *Engine

AddFunc adds the function to the template's function map. It is legal to overwrite elements of the default actions From: gofiber/template

func (*Engine) AddGlobal added in v1.1.0

func (e *Engine) AddGlobal(name string, value string) *Engine

AddGlobal adds Global to the template's Global map

func (*Engine) Load

func (e *Engine) Load() error

Load the templates to the engine.

func (*Engine) Render

func (e *Engine) Render(out io.Writer, template string, binding interface{}, layout ...string) error

Render the templates

Jump to

Keyboard shortcuts

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