Documentation ¶
Overview ¶
Package runtime provide a runtime for the pipeline
Index ¶
- Constants
- Variables
- func CastToStringE(val any, dtype ast.DType) (string, error)
- func Conv2String(v any, dtype ast.DType) (string, error)
- func PutContext(ctx *Context)
- type Context
- func GetContext() *Context
- func InitCtxForCheck(ctx *Context, funcs map[string]FuncCall, funcsCheck map[string]FuncCheck, ...) *Context
- func InitCtxWithRMap(ctx *Context, inWithRMap InputWithRMap, funcs map[string]FuncCall, ...) *Context
- func InitCtxWithoutMap(ctx *Context, inWithoutMap InputWithoutMap, funcs map[string]FuncCall, ...) *Context
- func (ctx *Context) GetCallRef(name string) (*Script, bool)
- func (ctx *Context) GetFuncCall(key string) (FuncCall, bool)
- func (ctx *Context) GetFuncCheck(key string) (FuncCheck, bool)
- func (ctx *Context) GetKey(key string) (*Varb, error)
- func (ctx *Context) GetKeyConv2Str(key string) (string, error)
- func (ctx *Context) GetPattern(pattern string) (*grok.GrokPattern, bool)
- func (ctx *Context) InData() any
- func (ctx *Context) ProcExit() bool
- func (ctx *Context) SetCallRef(name string)
- func (ctx *Context) SetExit()
- func (ctx *Context) SetPattern(patternAlias string, gPattern *grok.GrokPattern)
- func (ctx *Context) SetVarb(key string, value any, dtype ast.DType) error
- func (ctx *Context) StackClear()
- func (ctx *Context) StackEnterNew()
- func (ctx *Context) StackExitCur()
- func (ctx *Context) StmtRetrun() bool
- type ContextCheck
- type FilePos
- type FuncCall
- type FuncCheck
- type InType
- type InputWithRMap
- type InputWithoutMap
- type PlProcStack
- func (stack *PlProcStack) Clear()
- func (stack *PlProcStack) Get(key string) (*Varb, error)
- func (stack *PlProcStack) GetPattern(pattern string) (*grok.GrokPattern, bool)
- func (stack *PlProcStack) Set(key string, value any, dType ast.DType)
- func (stack *PlProcStack) SetPattern(patternAlias string, grokPattern *grok.GrokPattern)
- type PlReg
- type PlRegRange
- type RuntimeError
- func CheckScript(proc *Script, funcsCheck map[string]FuncCheck) *RuntimeError
- func NewRunError(ctx *Context, err string, pos token.Pos) *RuntimeError
- func RefRunScript(ctx *Context, proc *Script) *RuntimeError
- func RunArithmeticExpr(ctx *Context, expr *ast.ArithmeticExpr) (any, ast.DType, *RuntimeError)
- func RunArithmeticExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ArithmeticExpr) *RuntimeError
- func RunAssignmentExpr(ctx *Context, expr *ast.AssignmentExpr) (any, ast.DType, *RuntimeError)
- func RunAssignmentExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.AssignmentExpr) *RuntimeError
- func RunAttrExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.AttrExpr) *RuntimeError
- func RunBreakStmt(ctx *Context, stmt *ast.BreakStmt) (any, ast.DType, *RuntimeError)
- func RunBreakStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.BreakStmt) *RuntimeError
- func RunCallExpr(ctx *Context, expr *ast.CallExpr) (any, ast.DType, *RuntimeError)
- func RunCallExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.CallExpr) *RuntimeError
- func RunConditionExpr(ctx *Context, expr *ast.ConditionalExpr) (any, ast.DType, *RuntimeError)
- func RunConditionExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ConditionalExpr) *RuntimeError
- func RunContinueStmt(ctx *Context, stmt *ast.ContinueStmt) (any, ast.DType, *RuntimeError)
- func RunContinueStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ContinueStmt) *RuntimeError
- func RunForInStmt(ctx *Context, stmt *ast.ForInStmt) (any, ast.DType, *RuntimeError)
- func RunForInStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ForInStmt) *RuntimeError
- func RunForStmt(ctx *Context, stmt *ast.ForStmt) (any, ast.DType, *RuntimeError)
- func RunForStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ForStmt) *RuntimeError
- func RunIfElseStmt(ctx *Context, stmt *ast.IfelseStmt) (any, ast.DType, *RuntimeError)
- func RunIfElseStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.IfelseStmt) *RuntimeError
- func RunIndexExprGet(ctx *Context, expr *ast.IndexExpr) (any, ast.DType, *RuntimeError)
- func RunIndexExprGetCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.IndexExpr) *RuntimeError
- func RunListInitExpr(ctx *Context, expr *ast.ListInitExpr) (any, ast.DType, *RuntimeError)
- func RunListInitExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ListInitExpr) *RuntimeError
- func RunMapInitExpr(ctx *Context, expr *ast.MapInitExpr) (any, ast.DType, *RuntimeError)
- func RunMapInitExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.MapInitExpr) *RuntimeError
- func RunParenExpr(ctx *Context, expr *ast.ParenExpr) (any, ast.DType, *RuntimeError)
- func RunParenExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ParenExpr) *RuntimeError
- func RunScriptWithRMapIn(proc *Script, data InputWithRMap, signal Signal) *RuntimeError
- func RunScriptWithoutMapIn(proc *Script, data InputWithoutMap, signal Signal) *RuntimeError
- func RunStmt(ctx *Context, node *ast.Node) (any, ast.DType, *RuntimeError)
- func RunStmtCheck(ctx *Context, ctxCheck *ContextCheck, node *ast.Node) *RuntimeError
- func RunStmts(ctx *Context, nodes ast.Stmts) *RuntimeError
- func RunStmtsCheck(ctx *Context, ctxCheck *ContextCheck, nodes ast.Stmts) *RuntimeError
- type Script
- type Signal
- type Varb
Constants ¶
View Source
const ( InNoSet = iota InWithoutMap InRMap )
View Source
const ( RegR0 = iota RegR1 RegR2 RegR3 RegR4 RegR5 )
View Source
const (
PlRunInfoField = "pl_msg"
)
Variables ¶
View Source
var DenormalizedGlobalPatterns map[string]*grok.GrokPattern = grok.CopyDenormalizedDefalutPatterns()
Functions ¶
func PutContext ¶
func PutContext(ctx *Context)
Types ¶
type Context ¶
type Context struct { Regs PlReg // contains filtered or unexported fields }
func GetContext ¶
func GetContext() *Context
func InitCtxForCheck ¶
func InitCtxWithRMap ¶
func InitCtxWithoutMap ¶
func (*Context) GetPattern ¶
func (ctx *Context) GetPattern(pattern string) (*grok.GrokPattern, bool)
func (*Context) SetCallRef ¶
func (*Context) SetPattern ¶
func (ctx *Context) SetPattern(patternAlias string, gPattern *grok.GrokPattern)
func (*Context) StackClear ¶
func (ctx *Context) StackClear()
func (*Context) StackEnterNew ¶
func (ctx *Context) StackEnterNew()
func (*Context) StackExitCur ¶
func (ctx *Context) StackExitCur()
func (*Context) StmtRetrun ¶
type ContextCheck ¶
type ContextCheck struct {
// contains filtered or unexported fields
}
type InputWithoutMap ¶
type InputWithoutMap interface{}
type PlProcStack ¶
type PlProcStack struct {
// contains filtered or unexported fields
}
func (*PlProcStack) Clear ¶
func (stack *PlProcStack) Clear()
func (*PlProcStack) GetPattern ¶
func (stack *PlProcStack) GetPattern(pattern string) (*grok.GrokPattern, bool)
func (*PlProcStack) SetPattern ¶
func (stack *PlProcStack) SetPattern(patternAlias string, grokPattern *grok.GrokPattern)
type PlRegRange ¶
type PlRegRange uint
type RuntimeError ¶ added in v0.1.0
type RuntimeError struct {
// contains filtered or unexported fields
}
func CheckScript ¶
func CheckScript(proc *Script, funcsCheck map[string]FuncCheck) *RuntimeError
func NewRunError ¶ added in v0.1.0
func NewRunError(ctx *Context, err string, pos token.Pos) *RuntimeError
func RefRunScript ¶
func RefRunScript(ctx *Context, proc *Script) *RuntimeError
func RunArithmeticExpr ¶
func RunArithmeticExpr(ctx *Context, expr *ast.ArithmeticExpr) (any, ast.DType, *RuntimeError)
func RunArithmeticExprCheck ¶
func RunArithmeticExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ArithmeticExpr) *RuntimeError
func RunAssignmentExpr ¶
func RunAssignmentExpr(ctx *Context, expr *ast.AssignmentExpr) (any, ast.DType, *RuntimeError)
func RunAssignmentExprCheck ¶
func RunAssignmentExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.AssignmentExpr) *RuntimeError
func RunAttrExprCheck ¶
func RunAttrExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.AttrExpr) *RuntimeError
func RunBreakStmt ¶
func RunBreakStmtCheck ¶
func RunBreakStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.BreakStmt) *RuntimeError
func RunCallExpr ¶
func RunCallExprCheck ¶
func RunCallExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.CallExpr) *RuntimeError
func RunConditionExpr ¶
func RunConditionExpr(ctx *Context, expr *ast.ConditionalExpr) (any, ast.DType, *RuntimeError)
func RunConditionExprCheck ¶
func RunConditionExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ConditionalExpr) *RuntimeError
func RunContinueStmt ¶
func RunContinueStmt(ctx *Context, stmt *ast.ContinueStmt) (any, ast.DType, *RuntimeError)
func RunContinueStmtCheck ¶
func RunContinueStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ContinueStmt) *RuntimeError
func RunForInStmt ¶
func RunForInStmtCheck ¶
func RunForInStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ForInStmt) *RuntimeError
func RunForStmt ¶
func RunForStmtCheck ¶
func RunForStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.ForStmt) *RuntimeError
func RunIfElseStmt ¶
func RunIfElseStmt(ctx *Context, stmt *ast.IfelseStmt) (any, ast.DType, *RuntimeError)
func RunIfElseStmtCheck ¶
func RunIfElseStmtCheck(ctx *Context, ctxCheck *ContextCheck, stmt *ast.IfelseStmt) *RuntimeError
func RunIndexExprGet ¶
func RunIndexExprGetCheck ¶
func RunIndexExprGetCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.IndexExpr) *RuntimeError
func RunListInitExpr ¶
func RunListInitExpr(ctx *Context, expr *ast.ListInitExpr) (any, ast.DType, *RuntimeError)
func RunListInitExprCheck ¶
func RunListInitExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ListInitExpr) *RuntimeError
func RunMapInitExpr ¶
func RunMapInitExpr(ctx *Context, expr *ast.MapInitExpr) (any, ast.DType, *RuntimeError)
func RunMapInitExprCheck ¶
func RunMapInitExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.MapInitExpr) *RuntimeError
func RunParenExpr ¶
func RunParenExprCheck ¶
func RunParenExprCheck(ctx *Context, ctxCheck *ContextCheck, expr *ast.ParenExpr) *RuntimeError
func RunScriptWithRMapIn ¶
func RunScriptWithRMapIn(proc *Script, data InputWithRMap, signal Signal) *RuntimeError
func RunScriptWithoutMapIn ¶
func RunScriptWithoutMapIn(proc *Script, data InputWithoutMap, signal Signal) *RuntimeError
func RunStmtCheck ¶
func RunStmtCheck(ctx *Context, ctxCheck *ContextCheck, node *ast.Node) *RuntimeError
func RunStmtsCheck ¶
func RunStmtsCheck(ctx *Context, ctxCheck *ContextCheck, nodes ast.Stmts) *RuntimeError
func (*RuntimeError) ChainAppend ¶ added in v0.1.0
func (e *RuntimeError) ChainAppend(ctx *Context, pos token.Pos) *RuntimeError
func (*RuntimeError) ChainError ¶ added in v0.1.0
func (e *RuntimeError) ChainError() error
func (*RuntimeError) LastError ¶ added in v0.1.0
func (e *RuntimeError) LastError() error
Click to show internal directories.
Click to hide internal directories.