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 NewRunError(ctx *Task, err string, pos token.LnColPos) *errchain.PlError
- func PutContext(ctx *Task)
- func RunArithmeticExpr(ctx *Task, expr *ast.ArithmeticExpr) (any, ast.DType, *errchain.PlError)
- func RunArithmeticExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.ArithmeticExpr) *errchain.PlError
- func RunAssignmentExpr(ctx *Task, expr *ast.AssignmentExpr) (any, ast.DType, *errchain.PlError)
- func RunAssignmentExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.AssignmentExpr) *errchain.PlError
- func RunAttrExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.AttrExpr) *errchain.PlError
- func RunBreakStmt(ctx *Task, stmt *ast.BreakStmt) (any, ast.DType, *errchain.PlError)
- func RunBreakStmtCheck(ctx *Task, ctxCheck *ContextCheck, stmt *ast.BreakStmt) *errchain.PlError
- func RunCallExpr(ctx *Task, expr *ast.CallExpr) (any, ast.DType, *errchain.PlError)
- func RunCallExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.CallExpr) *errchain.PlError
- func RunConditionExpr(ctx *Task, expr *ast.ConditionalExpr) (any, ast.DType, *errchain.PlError)
- func RunConditionExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.ConditionalExpr) *errchain.PlError
- func RunContinueStmt(ctx *Task, stmt *ast.ContinueStmt) (any, ast.DType, *errchain.PlError)
- func RunContinueStmtCheck(ctx *Task, ctxCheck *ContextCheck, stmt *ast.ContinueStmt) *errchain.PlError
- func RunForInStmt(ctx *Task, stmt *ast.ForInStmt) (any, ast.DType, *errchain.PlError)
- func RunForInStmtCheck(ctx *Task, ctxCheck *ContextCheck, stmt *ast.ForInStmt) *errchain.PlError
- func RunForStmt(ctx *Task, stmt *ast.ForStmt) (any, ast.DType, *errchain.PlError)
- func RunForStmtCheck(ctx *Task, ctxCheck *ContextCheck, stmt *ast.ForStmt) *errchain.PlError
- func RunIfElseStmt(ctx *Task, stmt *ast.IfelseStmt) (any, ast.DType, *errchain.PlError)
- func RunIfElseStmtCheck(ctx *Task, ctxCheck *ContextCheck, stmt *ast.IfelseStmt) *errchain.PlError
- func RunInExpr(ctx *Task, expr *ast.InExpr) (any, ast.DType, *errchain.PlError)
- func RunIndexExprGet(ctx *Task, expr *ast.IndexExpr) (any, ast.DType, *errchain.PlError)
- func RunIndexExprGetCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.IndexExpr) *errchain.PlError
- func RunListInitExpr(ctx *Task, expr *ast.ListLiteral) (any, ast.DType, *errchain.PlError)
- func RunListInitExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.ListLiteral) *errchain.PlError
- func RunMapInitExpr(ctx *Task, expr *ast.MapLiteral) (any, ast.DType, *errchain.PlError)
- func RunMapInitExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.MapLiteral) *errchain.PlError
- func RunParenExpr(ctx *Task, expr *ast.ParenExpr) (any, ast.DType, *errchain.PlError)
- func RunParenExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.ParenExpr) *errchain.PlError
- func RunSliceExpr(ctx *Task, expr *ast.SliceExpr) (any, ast.DType, *errchain.PlError)
- func RunSliceExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.SliceExpr) *errchain.PlError
- func RunStmt(ctx *Task, node *ast.Node) (any, ast.DType, *errchain.PlError)
- func RunStmtCheck(ctx *Task, ctxCheck *ContextCheck, node *ast.Node) *errchain.PlError
- func RunStmts(ctx *Task, nodes ast.Stmts) *errchain.PlError
- func RunStmtsCheck(ctx *Task, ctxCheck *ContextCheck, nodes ast.Stmts) *errchain.PlError
- func RunUnaryExpr(ctx *Task, expr *ast.UnaryExpr) (any, ast.DType, *errchain.PlError)
- func RunUnaryExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.UnaryExpr) *errchain.PlError
- type ContextCheck
- type FuncCall
- type FuncCheck
- type Input
- 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 Script
- type Signal
- type Task
- func (ctx *Task) GetFuncCall(key string) (FuncCall, bool)
- func (ctx *Task) GetFuncCheck(key string) (FuncCheck, bool)
- func (ctx *Task) GetKey(key string) (*Varb, error)
- func (ctx *Task) GetKeyConv2Str(key string) (string, error)
- func (ctx *Task) GetPattern(pattern string) (*grok.GrokPattern, bool)
- func (ctx *Task) InData() any
- func (ctx *Task) Name() string
- func (ctx *Task) ProcExit() bool
- func (ctx *Task) SetCallRef(expr *ast.CallExpr)
- func (ctx *Task) SetExit()
- func (ctx *Task) SetPattern(patternAlias string, gPattern *grok.GrokPattern)
- func (ctx *Task) SetVarb(key string, value any, dtype ast.DType) error
- func (ctx *Task) Signal() Signal
- func (ctx *Task) StackClear()
- func (ctx *Task) StackEnterNew()
- func (ctx *Task) StackExitCur()
- func (ctx *Task) StmtRetrun() bool
- func (ctx *Task) Val(key any) any
- func (ctx *Task) WithVal(key, val any, force bool) error
- type TaskFn
- type Varb
Constants ¶
View Source
const ( RegR0 = iota RegR1 RegR2 RegR3 RegR4 RegR5 )
View Source
const (
PlRunInfoField = "pl_msg"
)
Variables ¶
View Source
var ( ErrNilKey = errors.New("key is nil") ErrKeyNotComparable = errors.New("key is not comparable") ErrKeyExists = errors.New("key exists") )
View Source
var DenormalizedGlobalPatterns map[string]*grok.GrokPattern = grok.CopyDenormalizedDefalutPatterns()
Functions ¶
func PutContext ¶
func PutContext(ctx *Task)
func RunArithmeticExpr ¶
func RunArithmeticExprCheck ¶
func RunArithmeticExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.ArithmeticExpr) *errchain.PlError
func RunAssignmentExpr ¶
RunAssignmentExpr runs assignment expression, but actually it is a stmt
func RunAssignmentExprCheck ¶
func RunAssignmentExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.AssignmentExpr) *errchain.PlError
func RunAttrExprCheck ¶
func RunBreakStmt ¶
func RunBreakStmtCheck ¶
func RunCallExpr ¶
func RunCallExprCheck ¶
func RunConditionExpr ¶
func RunConditionExprCheck ¶
func RunConditionExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.ConditionalExpr) *errchain.PlError
func RunContinueStmt ¶
func RunContinueStmtCheck ¶
func RunContinueStmtCheck(ctx *Task, ctxCheck *ContextCheck, stmt *ast.ContinueStmt) *errchain.PlError
func RunForInStmt ¶
func RunForInStmtCheck ¶
func RunForStmtCheck ¶
func RunIfElseStmt ¶
func RunIfElseStmtCheck ¶
func RunIfElseStmtCheck(ctx *Task, ctxCheck *ContextCheck, stmt *ast.IfelseStmt) *errchain.PlError
func RunIndexExprGet ¶
func RunIndexExprGetCheck ¶
func RunListInitExpr ¶
func RunListInitExprCheck ¶
func RunListInitExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.ListLiteral) *errchain.PlError
func RunMapInitExpr ¶
func RunMapInitExprCheck ¶
func RunMapInitExprCheck(ctx *Task, ctxCheck *ContextCheck, expr *ast.MapLiteral) *errchain.PlError
func RunParenExpr ¶
func RunParenExprCheck ¶
func RunSliceExpr ¶ added in v0.3.0
func RunSliceExprCheck ¶ added in v0.3.0
func RunStmtCheck ¶
func RunStmtsCheck ¶
func RunUnaryExpr ¶ added in v0.2.6
func RunUnaryExprCheck ¶ added in v0.2.8
Types ¶
type ContextCheck ¶
type ContextCheck struct {
// contains filtered or unexported fields
}
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 Script ¶
type Script struct { CallRef []*ast.CallExpr FuncCall map[string]FuncCall Name string Namespace string Category string FilePath string Content string // deprecated Ast ast.Stmts }
type Task ¶ added in v0.3.0
type Task struct { Regs PlReg // contains filtered or unexported fields }
func GetContext ¶
func GetContext() *Task
func InitCtxForCheck ¶
func (*Task) GetFuncCall ¶ added in v0.3.0
func (*Task) GetFuncCheck ¶ added in v0.3.0
func (*Task) GetKeyConv2Str ¶ added in v0.3.0
func (*Task) GetPattern ¶ added in v0.3.0
func (ctx *Task) GetPattern(pattern string) (*grok.GrokPattern, bool)
func (*Task) SetCallRef ¶ added in v0.3.0
func (*Task) SetPattern ¶ added in v0.3.0
func (ctx *Task) SetPattern(patternAlias string, gPattern *grok.GrokPattern)
func (*Task) StackClear ¶ added in v0.3.0
func (ctx *Task) StackClear()
func (*Task) StackEnterNew ¶ added in v0.3.0
func (ctx *Task) StackEnterNew()
func (*Task) StackExitCur ¶ added in v0.3.0
func (ctx *Task) StackExitCur()
func (*Task) StmtRetrun ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.