statictemplate: github.com/bouk/statictemplate/statictemplate Index | Files

package statictemplate

import "github.com/bouk/statictemplate/statictemplate"

Package statictemplate implements a code generator for converting text or html/template to Go code.

Index

Package Files

constant_writer_to.go statictemplate.go translate.go wrapper.go

func Translate Uses

func Translate(template interface{}, pkg string, instructions []TranslateInstruction) ([]byte, error)

Translate is a convenience method for New(template).Translate(pkg, instructions)

type TranslateInstruction Uses

type TranslateInstruction struct {
    FunctionName string
    TemplateName string
    Dot          reflect.Type
}

TranslateInstruction specifies a single function to be generated from a template

type Translator Uses

type Translator struct {
    Funcs map[string]interface{}
    // contains filtered or unexported fields
}

Translator converts a template with a set of instructions to Go code

func New Uses

func New(template interface{}) *Translator

New creates a new instance of Translator

func (*Translator) Translate Uses

func (t *Translator) Translate(pkg string, instructions []TranslateInstruction) ([]byte, error)

Translate converts a template with a set of instructions to Go code

Package statictemplate imports 13 packages (graph). Updated 2017-03-12. Refresh now. Tools for package owners.