go_sweetpl: github.com/daemonl/go_sweetpl Index | Files

package sweetpl

import "github.com/daemonl/go_sweetpl"

Index

Package Files

data.go loader.go template.go util.go

func Errf Uses

func Errf(format string, parameters ...interface{}) error

type DirLoader Uses

type DirLoader struct {
    BasePath string
}

func (*DirLoader) LoadTemplate Uses

func (l *DirLoader) LoadTemplate(name string) (string, error)

DirLoader.LoadTemplate gets BaseAddress + name. No safety checking yet.

type MapLoader Uses

type MapLoader map[string]string

func (*MapLoader) LoadTemplate Uses

func (l *MapLoader) LoadTemplate(name string) (string, error)

MapLoader.LoadTemplate gets name from a map.

type NamedTemplate Uses

type NamedTemplate struct {
    Name string
    Src  string
}

type SweeTpl Uses

type SweeTpl struct {
    Loader  TemplateLoader
    FuncMap map[string]interface{} //template.FuncMap

    ForceReload bool
    // contains filtered or unexported fields
}

func (*SweeTpl) ClearCache Uses

func (st *SweeTpl) ClearCache()

func (*SweeTpl) GetTemplate Uses

func (st *SweeTpl) GetTemplate(w io.Writer, name string) (*template.Template, error)

func (*SweeTpl) Render Uses

func (st *SweeTpl) Render(w io.Writer, name string, data interface{}) error

type TemplateData Uses

type TemplateData struct {
    Title string
    Path  string
    User  interface{}
    Nav   map[string]string
    Data  map[string]interface{}
}

type TemplateError Uses

type TemplateError struct {
    Format     string
    Parameters []interface{}
}

func (*TemplateError) Error Uses

func (e *TemplateError) Error() string

type TemplateLoader Uses

type TemplateLoader interface {
    LoadTemplate(string) (string, error)
}

Package sweetpl imports 7 packages (graph) and is imported by 2 packages. Updated 2017-01-29. Refresh now. Tools for package owners.