gerb: github.com/karlseguin/gerb Index | Files | Directories

package gerb

import "github.com/karlseguin/gerb"

Index

Package Files

break.go code.go configure.go content.go for.go gerb.go if.go output.go template.go

Variables

var Cache = ccache.New(ccache.Configure().MaxSize(5000))
var CodeFactories = map[string]CodeFactory{
    "if":       IfFactory,
    "content":  ContentFactory,
    "for":      ForFactory,
    "break":    BreakFactory,
    "continue": ContinueFactory,
}

func BreakFactory Uses

func BreakFactory(p *core.Parser) (core.Code, error)

func ContentFactory Uses

func ContentFactory(p *core.Parser) (core.Code, error)

func ContinueFactory Uses

func ContinueFactory(p *core.Parser) (core.Code, error)

func ElseFactory Uses

func ElseFactory(p *core.Parser) (core.Code, error)

func ExplicitForFactory Uses

func ExplicitForFactory(p *core.Parser) (core.Code, error)

func ForFactory Uses

func ForFactory(p *core.Parser) (core.Code, error)

func IfFactory Uses

func IfFactory(p *core.Parser) (core.Code, error)

func RangedForFactory Uses

func RangedForFactory(p *core.Parser) (core.Code, error)

type CodeFactory Uses

type CodeFactory func(*core.Parser) (core.Code, error)

type Configuration Uses

type Configuration struct{}

func Configure Uses

func Configure() *Configuration

func (*Configuration) Logger Uses

func (c *Configuration) Logger(logger core.Logger)

type ContentCode Uses

type ContentCode struct {
    *core.NormalContainer
    // contains filtered or unexported fields
}

func (*ContentCode) AddCode Uses

func (c *ContentCode) AddCode(core.Code) error

func (*ContentCode) Execute Uses

func (c *ContentCode) Execute(context *core.Context) core.ExecutionState

func (*ContentCode) IsCodeContainer Uses

func (c *ContentCode) IsCodeContainer() bool

func (*ContentCode) IsContentContainer Uses

func (c *ContentCode) IsContentContainer() bool

func (*ContentCode) IsSibling Uses

func (c *ContentCode) IsSibling() bool

type ControlFlowCode Uses

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

func (*ControlFlowCode) AddCode Uses

func (c *ControlFlowCode) AddCode(code core.Code) error

func (*ControlFlowCode) AddExecutable Uses

func (c *ControlFlowCode) AddExecutable(core.Executable)

func (*ControlFlowCode) Execute Uses

func (c *ControlFlowCode) Execute(context *core.Context) core.ExecutionState

func (*ControlFlowCode) IsCodeContainer Uses

func (c *ControlFlowCode) IsCodeContainer() bool

func (*ControlFlowCode) IsContentContainer Uses

func (c *ControlFlowCode) IsContentContainer() bool

func (*ControlFlowCode) IsSibling Uses

func (c *ControlFlowCode) IsSibling() bool

type ElseCode Uses

type ElseCode struct {
    *core.NormalContainer
    // contains filtered or unexported fields
}

func (*ElseCode) AddCode Uses

func (c *ElseCode) AddCode(core.Code) error

func (*ElseCode) IsCodeContainer Uses

func (c *ElseCode) IsCodeContainer() bool

func (*ElseCode) IsContentContainer Uses

func (c *ElseCode) IsContentContainer() bool

func (*ElseCode) IsSibling Uses

func (c *ElseCode) IsSibling() bool

type EndScope Uses

type EndScope struct{}

func (*EndScope) AddCode Uses

func (c *EndScope) AddCode(core.Code) error

func (*EndScope) AddExecutable Uses

func (c *EndScope) AddExecutable(e core.Executable)

func (*EndScope) Execute Uses

func (c *EndScope) Execute(context *core.Context) core.ExecutionState

func (*EndScope) IsCodeContainer Uses

func (c *EndScope) IsCodeContainer() bool

func (*EndScope) IsContentContainer Uses

func (c *EndScope) IsContentContainer() bool

func (*EndScope) IsSibling Uses

func (c *EndScope) IsSibling() bool

type ForCode Uses

type ForCode struct {
    *core.NormalContainer
    // contains filtered or unexported fields
}

func (*ForCode) AddCode Uses

func (c *ForCode) AddCode(code core.Code) error

func (*ForCode) Execute Uses

func (c *ForCode) Execute(context *core.Context) core.ExecutionState

func (*ForCode) IsCodeContainer Uses

func (c *ForCode) IsCodeContainer() bool

func (*ForCode) IsContentContainer Uses

func (c *ForCode) IsContentContainer() bool

func (*ForCode) IsSibling Uses

func (c *ForCode) IsSibling() bool

type IfCode Uses

type IfCode struct {
    *core.NormalContainer
    // contains filtered or unexported fields
}

func (*IfCode) AddCode Uses

func (c *IfCode) AddCode(code core.Code) error

func (*IfCode) Execute Uses

func (c *IfCode) Execute(context *core.Context) core.ExecutionState

func (*IfCode) IsCodeContainer Uses

func (c *IfCode) IsCodeContainer() bool

func (*IfCode) IsContentContainer Uses

func (c *IfCode) IsContentContainer() bool

func (*IfCode) IsSibling Uses

func (c *IfCode) IsSibling() bool

type OutputTag Uses

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

func (*OutputTag) Execute Uses

func (o *OutputTag) Execute(context *core.Context) core.ExecutionState

type RangedForCode Uses

type RangedForCode struct {
    *core.NormalContainer
    // contains filtered or unexported fields
}

func (*RangedForCode) AddCode Uses

func (c *RangedForCode) AddCode(code core.Code) error

func (*RangedForCode) Execute Uses

func (c *RangedForCode) Execute(context *core.Context) core.ExecutionState

func (*RangedForCode) IsCodeContainer Uses

func (c *RangedForCode) IsCodeContainer() bool

func (*RangedForCode) IsContentContainer Uses

func (c *RangedForCode) IsContentContainer() bool

func (*RangedForCode) IsSibling Uses

func (c *RangedForCode) IsSibling() bool

type Template Uses

type Template struct {
    *core.NormalContainer
}

func (*Template) AddCode Uses

func (t *Template) AddCode(core.Code) error

func (*Template) Close Uses

func (t *Template) Close(*core.Context) error

func (*Template) IsCodeContainer Uses

func (t *Template) IsCodeContainer() bool

func (*Template) IsContentContainer Uses

func (t *Template) IsContentContainer() bool

func (*Template) IsSibling Uses

func (t *Template) IsSibling() bool

type TemplateChain Uses

type TemplateChain []core.Executable

a chain of templates to render from inner-most to outer-most

func Parse Uses

func Parse(cache bool, data ...[]byte) (TemplateChain, error)

Parse the bytes into a gerb template

func ParseFile Uses

func ParseFile(cache bool, paths ...string) (TemplateChain, error)

Turn the contents of the specified file into a gerb template

func ParseString Uses

func ParseString(cache bool, data ...string) (TemplateChain, error)

Parse the string into a erb template

func (TemplateChain) Render Uses

func (t TemplateChain) Render(writer io.Writer, data map[string]interface{})

Directories

PathSynopsis
core
r

Package gerb imports 12 packages (graph) and is imported by 5 packages. Updated 2016-07-29. Refresh now. Tools for package owners.