Documentation ¶
Index ¶
- Constants
- Variables
- func HaveYakcCache(code string) ([]byte, bool)
- func HaveYakcCacheWithKey(code string, key []byte) ([]byte, bool)
- func IsCryptoYakc(b []byte) bool
- func IsNormalYakc(b []byte) bool
- func IsYakc(b []byte) bool
- func SaveYakcCache(code string, yakc []byte)
- func SaveYakcCacheWithKey(code string, yakc []byte, key []byte)
- type Engine
- func (n *Engine) CallYakFunction(ctx context.Context, funcName string, params []interface{}) (interface{}, error)
- func (n *Engine) CallYakFunctionNative(ctx context.Context, function *yakvm.Function, params ...interface{}) (interface{}, error)
- func (n *Engine) Compile(code string) ([]*yakvm.Code, error)
- func (n *Engine) CopyVars() map[string]interface{}
- func (n *Engine) EnableDebug()
- func (n *Engine) EnableStrictMode()
- func (n *Engine) Eval(ctx context.Context, code string) error
- func (n *Engine) EvalInline(ctx context.Context, code string) error
- func (n *Engine) EvalWithInline(ctx context.Context, code string, inline bool) error
- func (n *Engine) ExecYakc(ctx context.Context, b []byte, key []byte) error
- func (n *Engine) ExecYakcWithCode(ctx context.Context, b []byte, key []byte, code string) error
- func (n *Engine) ExecuteAsBooleanExpression(expr string, dependencies map[string]interface{}) (bool, error)
- func (n *Engine) ExecuteAsExpression(expr string, dependencies map[string]interface{}) (interface{}, error)
- func (n *Engine) FormattedAndSyntaxChecking(code string) (string, error)
- func (n *Engine) GetCurrentScope() (*yakvm.Scope, error)
- func (n *Engine) GetFntable() map[string]interface{}
- func (n *Engine) GetLastStackValue() (*yakvm.Value, error)
- func (n *Engine) GetScopeInspects() ([]*ScopeValue, error)
- func (n *Engine) GetSymNames() []string
- func (n *Engine) GetVM() *yakvm.VirtualMachine
- func (n *Engine) GetVar(name string) (interface{}, bool)
- func (n *Engine) HaveEvaluatedCode() bool
- func (n *Engine) ImportLibs(libs map[string]interface{})
- func (n *Engine) ImportSubLibs(parent string, libs map[string]interface{})
- func (n *Engine) LoadCode(ctx context.Context, code string, table map[string]interface{}) error
- func (n *Engine) Marshal(code string, key []byte) ([]byte, error)
- func (n *Engine) MustCompile(code string) []*yakvm.Code
- func (n *Engine) RunFile(ctx context.Context, path string) error
- func (n *Engine) SafeEval(ctx context.Context, code string) (err error)
- func (n *Engine) SafeEvalInline(ctx context.Context, code string) (err error)
- func (n *Engine) SafeExecYakc(ctx context.Context, b []byte, key []byte) (fErr error)
- func (n *Engine) SafeExecYakcWithCode(ctx context.Context, b []byte, key []byte, code string) (fErr error)
- func (n *Engine) SetDebugCallback(callback func(*yakvm.Debugger))
- func (n *Engine) SetDebugInit(callback func(*yakvm.Debugger))
- func (n *Engine) SetDebugMode(debug bool)
- func (n *Engine) SetSourceFilePath(path string)
- func (n *Engine) SetVar(k string, v interface{})
- func (n *Engine) UnMarshal(b []byte, key []byte) (*yakvm.SymbolTable, []*yakvm.Code, error)
- func (n *Engine) Var(name string) interface{}
- type Executor
- type FakeCompiler
- type FakeVM
- type ScopeValue
Constants ¶
View Source
const YAKC_CACHE_MAX_LENGTH = 300
Variables ¶
View Source
var ( MAGIC_NUMBER = []byte{0xbc, 0xed} CRYPTO_MAGIC_NUMBER = []byte{0xcc, 0xed} )
Functions ¶
func HaveYakcCache ¶
func IsCryptoYakc ¶
func IsNormalYakc ¶
func SaveYakcCache ¶
func SaveYakcCacheWithKey ¶
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) CallYakFunction ¶
func (n *Engine) CallYakFunction(ctx context.Context, funcName string, params []interface{}) (interface{}, error)
函数调用时如果不加锁,并发会有问题
func (*Engine) CallYakFunctionNative ¶
func (*Engine) EnableDebug ¶
func (n *Engine) EnableDebug()
func (*Engine) EnableStrictMode ¶
func (n *Engine) EnableStrictMode()
func (*Engine) EvalWithInline ¶
func (*Engine) ExecYakcWithCode ¶
func (*Engine) ExecuteAsBooleanExpression ¶
func (*Engine) ExecuteAsExpression ¶
func (*Engine) FormattedAndSyntaxChecking ¶
func (*Engine) GetFntable ¶
func (*Engine) GetScopeInspects ¶
func (n *Engine) GetScopeInspects() ([]*ScopeValue, error)
func (*Engine) GetSymNames ¶
func (*Engine) GetVM ¶
func (n *Engine) GetVM() *yakvm.VirtualMachine
func (*Engine) HaveEvaluatedCode ¶
func (*Engine) ImportLibs ¶
func (*Engine) ImportSubLibs ¶
func (*Engine) SafeEvalInline ¶
func (*Engine) SafeExecYakc ¶
func (*Engine) SafeExecYakcWithCode ¶
func (*Engine) SetDebugCallback ¶
func (*Engine) SetDebugInit ¶
func (*Engine) SetDebugMode ¶
func (*Engine) SetSourceFilePath ¶
type FakeCompiler ¶
type FakeCompiler struct {
// contains filtered or unexported fields
}
func (*FakeCompiler) GetErrors ¶
func (f *FakeCompiler) GetErrors() yakast.YakMergeError
func (*FakeCompiler) GetFormattedCode ¶
func (f *FakeCompiler) GetFormattedCode() string
type FakeVM ¶
type FakeVM struct {
// contains filtered or unexported fields
}
func (*FakeVM) NormalExec ¶
func (f *FakeVM) NormalExec()
type ScopeValue ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.