Documentation
¶
Index ¶
- Constants
- Variables
- func CleanRegexpObject(object cache.CacheObject) error
- func CleanXpathExpObject(object cache.CacheObject) error
- func GenerateHostMapKey(key, secure string) (newKey string, append_proto, append_slashes bool)
- func GetCharsetFromContentType(ct string) string
- func IsDomainCovered(domain1, domain2 string) bool
- func LogEngineError(ctx *EngineContext, errmsg string)
- func LookupBuiltIn(name string) builtInFunc
- func MoveFunc(what, where hx.Node, position Position)
- func NodeToJson(node hx.Node) (retVal interface{})
- func NodeToJsonArray(node hx.Node, json []interface{}) []interface{}
- func NodeToJsonHash(node hx.Node, json map[string]interface{}) map[string]interface{}
- func ReformatHostMapValue(value string, append_proto, append_slashes bool) (newValue string)
- func UpdateEnv(env map[string]string, export [][]string)
- func WrapJsonError(err interface{}) map[string]string
- type EngineContext
- func (ctx *EngineContext) AddExport(exports []string)
- func (ctx *EngineContext) AddLog(log string) int
- func (ctx *EngineContext) AddMemoryObject(o MemoryObject)
- func (ctx *EngineContext) FileAndLine(ins protoface.Instruction) string
- func (ctx *EngineContext) Free()
- func (ctx *EngineContext) GetEnv(key string) (val string)
- func (ctx *EngineContext) GetHeaderContentTypeRegex() (r *rubex.Regexp)
- func (ctx *EngineContext) GetInnerReplacer() (r *rubex.Regexp)
- func (ctx *EngineContext) GetOutputBuffer() (b []byte)
- func (ctx *EngineContext) GetRegexp(pattern, options string) (r *rubex.Regexp)
- func (ctx *EngineContext) GetVar(key string) (val interface{})
- func (ctx *EngineContext) GetXpathExpr(p string) (e hx.Selector)
- func (ctx *EngineContext) HasYieldBlock() bool
- func (ctx *EngineContext) MatchTarget() string
- func (ctx *EngineContext) PopMatchStack() (match string)
- func (ctx *EngineContext) PopShouldContinueStack() (cont bool)
- func (ctx *EngineContext) PopYieldBlock() (b *YieldBlock)
- func (ctx *EngineContext) PushMatchStack(match string)
- func (ctx *EngineContext) PushShouldContinueStack(cont bool)
- func (ctx *EngineContext) PushYieldBlock(b *YieldBlock)
- func (ctx *EngineContext) RunInstruction(scope *Scope, ins protoface.Instruction) (returnValue interface{})
- func (ctx *EngineContext) SetEnv(key, val string)
- func (ctx *EngineContext) SetShouldContinue(cont bool)
- func (ctx *EngineContext) SetVar(key string, val interface{})
- func (ctx *EngineContext) ShouldContinue() (result bool)
- func (ctx *EngineContext) TopYieldBlock() (b *YieldBlock)
- func (ctx *EngineContext) UpdateLog(index int, log string)
- func (ctx *EngineContext) UsePackage(pkg protoface.Package)
- func (ctx *EngineContext) Vars() map[string]interface{}
- type Function
- type MemoryObject
- type Position
- type RegexpObject
- type Scope
- type Whale
- type XpathExpObject
- type YieldBlock
Constants ¶
View Source
const ( TOP = iota BOTTOM BEFORE AFTER )
View Source
const OutputBufferSize = 500 * 1024 //500KB
View Source
const TimeoutError = "EngineTimeout"
Variables ¶
View Source
var Positions = map[string]Position{ "top": TOP, "bottom": BOTTOM, "before": BEFORE, "after": AFTER, "above": BEFORE, "below": AFTER, }
View Source
var TritiumLogRewritersAsImports = false
Functions ¶
func CleanRegexpObject ¶
func CleanRegexpObject(object cache.CacheObject) error
func CleanXpathExpObject ¶
func CleanXpathExpObject(object cache.CacheObject) error
func GenerateHostMapKey ¶
func IsDomainCovered ¶
true if domain1 is less restrictive than domain2
func LogEngineError ¶
func LogEngineError(ctx *EngineContext, errmsg string)
func LookupBuiltIn ¶
func LookupBuiltIn(name string) builtInFunc
func NodeToJson ¶
func NodeToJsonArray ¶
func NodeToJsonHash ¶
func ReformatHostMapValue ¶
func WrapJsonError ¶
Types ¶
type EngineContext ¶
type EngineContext struct {
Functions []*Function
Types []string
Exports [][]string
Logs []string
ImportedFiles []string
Env map[string]string
MatchStack []string
MatchShouldContinueStack []bool
Yields []*YieldBlock
*Whale
protoface.Transform
Rrules []protoface.RewriteRule
InnerReplacer *rubex.Regexp
HeaderContentType *rubex.Regexp
// Debug info
Filename string
HadError bool
Deadline time.Time
Mobjects []MemoryObject
MessagePath string
Customer string
Project string
InDebug bool
CurrentDoc interface{}
Warnings int
Prod bool
HtmlParsed bool
Constants map[string]string
ActiveLayers map[string]bool
ActiveLayersString string
HtmlTransformer hx.HtmlTransformer
}
func NewEngineCtx ¶
func (*EngineContext) AddExport ¶
func (ctx *EngineContext) AddExport(exports []string)
func (*EngineContext) AddLog ¶
func (ctx *EngineContext) AddLog(log string) int
func (*EngineContext) AddMemoryObject ¶
func (ctx *EngineContext) AddMemoryObject(o MemoryObject)
func (*EngineContext) FileAndLine ¶
func (ctx *EngineContext) FileAndLine(ins protoface.Instruction) string
func (*EngineContext) Free ¶
func (ctx *EngineContext) Free()
func (*EngineContext) GetEnv ¶
func (ctx *EngineContext) GetEnv(key string) (val string)
func (*EngineContext) GetHeaderContentTypeRegex ¶
func (ctx *EngineContext) GetHeaderContentTypeRegex() (r *rubex.Regexp)
func (*EngineContext) GetInnerReplacer ¶
func (ctx *EngineContext) GetInnerReplacer() (r *rubex.Regexp)
func (*EngineContext) GetOutputBuffer ¶
func (ctx *EngineContext) GetOutputBuffer() (b []byte)
func (*EngineContext) GetRegexp ¶
func (ctx *EngineContext) GetRegexp(pattern, options string) (r *rubex.Regexp)
func (*EngineContext) GetVar ¶
func (ctx *EngineContext) GetVar(key string) (val interface{})
func (*EngineContext) GetXpathExpr ¶
func (ctx *EngineContext) GetXpathExpr(p string) (e hx.Selector)
func (*EngineContext) HasYieldBlock ¶
func (ctx *EngineContext) HasYieldBlock() bool
func (*EngineContext) MatchTarget ¶
func (ctx *EngineContext) MatchTarget() string
func (*EngineContext) PopMatchStack ¶
func (ctx *EngineContext) PopMatchStack() (match string)
func (*EngineContext) PopShouldContinueStack ¶
func (ctx *EngineContext) PopShouldContinueStack() (cont bool)
func (*EngineContext) PopYieldBlock ¶
func (ctx *EngineContext) PopYieldBlock() (b *YieldBlock)
func (*EngineContext) PushMatchStack ¶
func (ctx *EngineContext) PushMatchStack(match string)
func (*EngineContext) PushShouldContinueStack ¶
func (ctx *EngineContext) PushShouldContinueStack(cont bool)
func (*EngineContext) PushYieldBlock ¶
func (ctx *EngineContext) PushYieldBlock(b *YieldBlock)
func (*EngineContext) RunInstruction ¶
func (ctx *EngineContext) RunInstruction(scope *Scope, ins protoface.Instruction) (returnValue interface{})
func (*EngineContext) SetEnv ¶
func (ctx *EngineContext) SetEnv(key, val string)
func (*EngineContext) SetShouldContinue ¶
func (ctx *EngineContext) SetShouldContinue(cont bool)
func (*EngineContext) SetVar ¶
func (ctx *EngineContext) SetVar(key string, val interface{})
func (*EngineContext) ShouldContinue ¶
func (ctx *EngineContext) ShouldContinue() (result bool)
func (*EngineContext) TopYieldBlock ¶
func (ctx *EngineContext) TopYieldBlock() (b *YieldBlock)
func (*EngineContext) UpdateLog ¶
func (ctx *EngineContext) UpdateLog(index int, log string)
func (*EngineContext) UsePackage ¶
func (ctx *EngineContext) UsePackage(pkg protoface.Package)
func (*EngineContext) Vars ¶
func (ctx *EngineContext) Vars() map[string]interface{}
type MemoryObject ¶
type MemoryObject interface {
Free()
}
type RegexpObject ¶
func (*RegexpObject) Size ¶
func (o *RegexpObject) Size() int
type Whale ¶
type Whale struct {
Debugger steno.Debugger
RegexpCache cache.Cache
XPathCache map[string]hx.Selector
}
func (*Whale) GetCacheStats ¶
type XpathExpObject ¶
func (*XpathExpObject) Size ¶
func (o *XpathExpObject) Size() int
type YieldBlock ¶
type YieldBlock struct {
Ins protoface.Instruction
Vars map[string]interface{}
Filename string
}
Click to show internal directories.
Click to hide internal directories.