Documentation ¶
Index ¶
- type BindMode
- type CodeFS
- func (cfs *CodeFS) Mapping(pkgRoot, localPath string) error
- func (cfs *CodeFS) Open(name string) (file fs.File, err error)
- func (cfs *CodeFS) ReadDir(name string) (files []fs.DirEntry, err error)
- func (cfs *CodeFS) ReadFile(name string) ([]byte, error)
- func (cfs *CodeFS) Stat(name string) (fs.FileInfo, error)
- type Method
- type MethodBinder
- type Project
- type Script
- type ScriptLib
- func (lib ScriptLib) Compile(i *interp.Interpreter) error
- func (lib ScriptLib) Load(localPath string) error
- func (lib ScriptLib) Package(pkgPath string) Scripts
- func (lib ScriptLib) PushIdent(pkgPath, ident string, bindMode BindMode, this *This) bool
- func (lib ScriptLib) PushMethod(pkgPath, ident string, method string) bool
- func (lib ScriptLib) Range(fun generic.Func2[string, Scripts, bool])
- type Scripts
- type Solution
- func (s *Solution) BindMethod(this reflect.Value, pkgPath, ident string, method string) any
- func (s *Solution) Eval(code string) (reflect.Value, error)
- func (s *Solution) Load(project *Project) error
- func (s *Solution) Method(pkgPath, method string) reflect.Value
- func (s *Solution) Package(pkgPath string) Scripts
- func (s *Solution) Range(fun generic.Func2[string, Scripts, bool])
- func (s *Solution) Use(symbols interp.Exports) error
- type This
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodeFS ¶
type CodeFS struct {
// contains filtered or unexported fields
}
CodeFS 代码文件系统
type Project ¶
type Project struct { PkgRoot string // 包根路径 LocalPath string // 本地路径 SymbolsTab []interp.Exports // 符号表 }
Project 项目
type Script ¶
type Script struct { PkgName string // 包名 PkgPath string // 包路径 Ident string // 类型标识,为空表示脚本均为全局方法 BindMode BindMode // 绑定模式 This *This // This类型 Methods []*Method // 方法列表 MethodBinder MethodBinder // 成员方法绑定器 }
Script 脚本
type ScriptLib ¶
ScriptLib 脚本库
func (ScriptLib) PushMethod ¶
PushMethod 添加方法
Click to show internal directories.
Click to hide internal directories.