template

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package template provides functions for handling templates

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// Name holds the template name
	Name string
	// FilePath holds the file path
	FilePath string
	// Content holds the template content
	Content string
	// Data holds the template data
	Data interface{}
}

Options represents the options that can be set when creating a new template

type Template

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

Template represent a template

func New

func New(o Options) (*Template, error)

New returns a new template by the given options

func (*Template) Execute

func (t *Template) Execute(data interface{}) (string, error)

Execute executes the template by the template data

Jump to

Keyboard shortcuts

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