amber

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2016 License: MIT Imports: 7 Imported by: 3

README

Folder information

This folder contains the buit'n amber cross-framework template engine support.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Funcs for the html/template result, amber default funcs are not overrided so use it without worries
	Funcs map[string]interface{}
}

Config contains fields useful to configure this template engine

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration

type Engine

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

Engine the amber template engine

func New

func New(cfg ...Config) *Engine

New creates and returns a new amber engine

func (*Engine) ExecuteRaw

func (e *Engine) ExecuteRaw(src string, wr io.Writer, binding interface{}) (err error)

ExecuteRaw receives, parse and executes raw source template contents it's super-simple function without options and funcs, it's not used widely implements the EngineRawExecutor interface

func (*Engine) ExecuteWriter

func (e *Engine) ExecuteWriter(out io.Writer, name string, binding interface{}, options ...map[string]interface{}) error

ExecuteWriter executes a templates and write its results to the out writer

func (*Engine) Funcs

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

Funcs should returns the helper funcs

func (*Engine) LoadAssets

func (e *Engine) LoadAssets(virtualDirectory string, virtualExtension string, assetFn func(name string) ([]byte, error), namesFn func() []string) error

LoadAssets builds the templates from binary assets

func (*Engine) LoadDirectory

func (e *Engine) LoadDirectory(directory string, extension string) error

LoadDirectory builds the amber templates

Jump to

Keyboard shortcuts

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