Documentation ¶
Index ¶
- Variables
- func BreakFactory(p *core.Parser) (core.Code, error)
- func ContentFactory(p *core.Parser) (core.Code, error)
- func ContinueFactory(p *core.Parser) (core.Code, error)
- func ElseFactory(p *core.Parser) (core.Code, error)
- func ExplicitForFactory(p *core.Parser) (core.Code, error)
- func ForFactory(p *core.Parser) (core.Code, error)
- func IfFactory(p *core.Parser) (core.Code, error)
- func RangedForFactory(p *core.Parser) (core.Code, error)
- type CodeFactory
- type Configuration
- type ContentCode
- type ControlFlowCode
- func (c *ControlFlowCode) AddCode(code core.Code) error
- func (c *ControlFlowCode) AddExecutable(core.Executable)
- func (c *ControlFlowCode) Execute(context *core.Context) core.ExecutionState
- func (c *ControlFlowCode) IsCodeContainer() bool
- func (c *ControlFlowCode) IsContentContainer() bool
- func (c *ControlFlowCode) IsSibling() bool
- type ElseCode
- type EndScope
- type ForCode
- type IfCode
- type OutputTag
- type RangedForCode
- type Template
- type TemplateChain
Constants ¶
This section is empty.
Variables ¶
View Source
var Cache = ccache.New(ccache.Configure().MaxItems(1024 * 1024 * 10))
View Source
var CodeFactories = map[string]CodeFactory{ "if": IfFactory, "content": ContentFactory, "for": ForFactory, "break": BreakFactory, "continue": ContinueFactory, }
Functions ¶
Types ¶
type Configuration ¶
type Configuration struct{}
func Configure ¶
func Configure() *Configuration
func (*Configuration) Logger ¶
func (c *Configuration) Logger(logger core.Logger)
func (*Configuration) MaxContentSize ¶
func (c *Configuration) MaxContentSize(size int)
func (*Configuration) MinContentPoolSize ¶
func (c *Configuration) MinContentPoolSize(count int)
type ContentCode ¶
type ContentCode struct { *core.NormalContainer // contains filtered or unexported fields }
func (*ContentCode) Execute ¶
func (c *ContentCode) Execute(context *core.Context) core.ExecutionState
func (*ContentCode) IsCodeContainer ¶
func (c *ContentCode) IsCodeContainer() bool
func (*ContentCode) IsContentContainer ¶
func (c *ContentCode) IsContentContainer() bool
func (*ContentCode) IsSibling ¶
func (c *ContentCode) IsSibling() bool
type ControlFlowCode ¶
type ControlFlowCode struct {
// contains filtered or unexported fields
}
func (*ControlFlowCode) AddExecutable ¶
func (c *ControlFlowCode) AddExecutable(core.Executable)
func (*ControlFlowCode) Execute ¶
func (c *ControlFlowCode) Execute(context *core.Context) core.ExecutionState
func (*ControlFlowCode) IsCodeContainer ¶
func (c *ControlFlowCode) IsCodeContainer() bool
func (*ControlFlowCode) IsContentContainer ¶
func (c *ControlFlowCode) IsContentContainer() bool
func (*ControlFlowCode) IsSibling ¶
func (c *ControlFlowCode) IsSibling() bool
type ElseCode ¶
type ElseCode struct { *core.NormalContainer // contains filtered or unexported fields }
func (*ElseCode) IsCodeContainer ¶
func (*ElseCode) IsContentContainer ¶
type EndScope ¶
type EndScope struct{}
func (*EndScope) AddExecutable ¶
func (c *EndScope) AddExecutable(e core.Executable)
func (*EndScope) IsCodeContainer ¶
func (*EndScope) IsContentContainer ¶
type ForCode ¶
type ForCode struct { *core.NormalContainer // contains filtered or unexported fields }
func (*ForCode) IsCodeContainer ¶
func (*ForCode) IsContentContainer ¶
type IfCode ¶
type IfCode struct { *core.NormalContainer // contains filtered or unexported fields }
func (*IfCode) IsCodeContainer ¶
func (*IfCode) IsContentContainer ¶
type RangedForCode ¶
type RangedForCode struct { *core.NormalContainer // contains filtered or unexported fields }
func (*RangedForCode) Execute ¶
func (c *RangedForCode) Execute(context *core.Context) core.ExecutionState
func (*RangedForCode) IsCodeContainer ¶
func (c *RangedForCode) IsCodeContainer() bool
func (*RangedForCode) IsContentContainer ¶
func (c *RangedForCode) IsContentContainer() bool
func (*RangedForCode) IsSibling ¶
func (c *RangedForCode) IsSibling() bool
type Template ¶
type Template struct {
*core.NormalContainer
}
func (*Template) IsCodeContainer ¶
func (*Template) IsContentContainer ¶
type TemplateChain ¶
type TemplateChain []core.Executable
a chain of templates to render from inner-most to outer-most
func Parse ¶
func Parse(cache bool, data ...[]byte) (TemplateChain, error)
Parse the bytes into a gerb template
func ParseFile ¶
func ParseFile(cache bool, paths ...string) (TemplateChain, error)
Turn the contents of the specified file into a gerb template
func ParseString ¶
func ParseString(cache bool, data ...string) (TemplateChain, error)
Parse the string into a erb template
Source Files ¶
Click to show internal directories.
Click to hide internal directories.