Documentation ¶
Index ¶
- Variables
- func InstName(root string, file string) string
- func Walk(root string, extensions []string, cb func(root, filename string) error) error
- type Handler
- type Instance
- type ModuleRegister
- type ProcessRegister
- type Widget
- func (w *Widget) CompileCompile(name string, dsl map[string]interface{}) (res map[string]interface{}, err error)
- func (w *Widget) CompileExec(method string, args ...interface{}) (interface{}, error)
- func (w *Widget) CompileOnLoad(name string, dsl map[string]interface{}) (err error)
- func (w *Widget) CompileSource() (res map[string][]byte, err error)
- func (w *Widget) Exec(name, method string, args ...interface{}) (interface{}, error)
- func (w *Widget) Export(method, name string, dsl map[string]interface{}) (res map[string][]byte, err error)
- func (w *Widget) ExportExec(method string, args ...interface{}) (interface{}, error)
- func (w *Widget) InstanceRoot() (string, error)
- func (w *Widget) Load() error
- func (w *Widget) LoadInstance(source []byte, name string) error
- func (w *Widget) LoadInstanceFile(file string, name string) error
- func (w *Widget) Migrate() error
- func (w *Widget) ProcessExec(method string, args ...interface{}) (interface{}, error)
- func (w *Widget) RegisterAPI() (err error)
- func (w *Widget) RegisterModule(module, name string, dsl map[string]interface{}) (err error)
- func (w *Widget) RegisterProcess() (err error)
- func (w *Widget) ReloadInstance(source []byte, name string) error
- func (w *Widget) ReloadInstanceFile(file string, name string) error
- func (w *Widget) RemoveInstance(name string)
- func (w *Widget) ScriptExec(scriptName, method string, args ...interface{}) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
var Widgets = map[string]*Widget{}
Widgets the registered widgets
Functions ¶
Types ¶
type ModuleRegister ¶
ModuleRegister register model, flow, etc.
type ProcessRegister ¶
ProcessRegister register process
type Widget ¶
type Widget struct { Name string Path string Label string `json:"label,omitempty"` Description string `json:"description,omitempty"` Version string `json:"version,omitempty"` Root string `json:"root,omitempty"` Extensions []string `json:"extensions,omitempty"` Modules []string `json:"modules,omitempty"` Handlers map[string]Handler Instances map[string]*Instance ModuleRegister ModuleRegister ProcessRegister ProcessRegister }
Widget the widget structs
func Load ¶
func Load(path string, processRegister ProcessRegister, moduleRegister ModuleRegister) (*Widget, error)
Load load a widget
func LoadWidget ¶ added in v0.10.3
func LoadWidget(path string, name string, register ModuleRegister) (*Widget, error)
LoadWidget load widgets
func (*Widget) CompileCompile ¶
func (w *Widget) CompileCompile(name string, dsl map[string]interface{}) (res map[string]interface{}, err error)
CompileCompile Execute the compile.js Compile function
func (*Widget) CompileExec ¶
CompileExec Execute the compile script
func (*Widget) CompileOnLoad ¶
CompileOnLoad Execute the compile.js OnLoad function
func (*Widget) CompileSource ¶
CompileSource Execute the compile.js Source function
func (*Widget) Export ¶
func (w *Widget) Export(method, name string, dsl map[string]interface{}) (res map[string][]byte, err error)
Export Execute the export.js Models function and return map[string][]byte
func (*Widget) ExportExec ¶
ExportExec Execute the export script
func (*Widget) InstanceRoot ¶
InstanceRoot get the instance root path
func (*Widget) LoadInstance ¶
LoadInstance load a instance
func (*Widget) LoadInstanceFile ¶
LoadInstanceFile load a instance from a file
func (*Widget) ProcessExec ¶
ProcessExec Execute the process script
func (*Widget) RegisterAPI ¶
RegisterAPI Execute the export.js API function and register the Apis
func (*Widget) RegisterModule ¶
RegisterModule Execute the export.js name function and register the modules
func (*Widget) RegisterProcess ¶
RegisterProcess Execute the process.js Export function and register the process
func (*Widget) ReloadInstance ¶
ReloadInstance reload the widget instance
func (*Widget) ReloadInstanceFile ¶
ReloadInstanceFile reload the widget instance from file
func (*Widget) RemoveInstance ¶
RemoveInstance remove the widget instance
func (*Widget) ScriptExec ¶
ScriptExec Execute the other script