statictemplate: Index | Files

package statictemplate

import ""

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


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          types.Type

TranslateInstruction specifies a single function to be generated from a template

type Translator Uses

type Translator struct {
    Funcs map[string]*types.Func
    // 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 12 packages (graph) and is imported by 1 packages. Updated 2018-08-22. Refresh now. Tools for package owners.