Documentation
¶
Index ¶
- type Pool
- type Yao
- func (yao *Yao) AddFunction(name string, ...) error
- func (yao *Yao) AddFunctionTemplates(tmpls map[string]*v8go.FunctionTemplate) error
- func (yao *Yao) AddObject(name string, ...) error
- func (yao *Yao) AddObjectTemplate(name string, object *v8go.ObjectTemplate) error
- func (yao *Yao) AddRootFunction(name string, ...) error
- func (yao *Yao) Call(data map[string]interface{}, name string, method string, args ...interface{}) (interface{}, error)
- func (yao *Yao) Has(name string) bool
- func (yao *Yao) Init() error
- func (yao *Yao) Load(filename string, name string) error
- func (yao *Yao) LoadReader(reader io.Reader, name string, filename ...string) error
- func (yao *Yao) RootCall(data map[string]interface{}, name string, method string, args ...interface{}) (interface{}, error)
- func (yao *Yao) RootLoad(filename string, name string) error
- func (yao *Yao) RootLoadReader(reader io.Reader, name string, filename ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool JS contect pool
type Yao ¶
type Yao struct {
// contains filtered or unexported fields
}
Yao runtime engine ( base on v8)
func (*Yao) AddFunction ¶
func (yao *Yao) AddFunction(name string, fn func(global map[string]interface{}, sid string, args ...interface{}) interface{}) error
AddFunction add a global function
func (*Yao) AddFunctionTemplates ¶
func (yao *Yao) AddFunctionTemplates(tmpls map[string]*v8go.FunctionTemplate) error
AddFunctionTemplates add function templates to global
func (*Yao) AddObject ¶
func (yao *Yao) AddObject(name string, methods map[string]func(global map[string]interface{}, sid string, args ...interface{}) interface{}) error
AddObject add a global object
func (*Yao) AddObjectTemplate ¶
func (yao *Yao) AddObjectTemplate(name string, object *v8go.ObjectTemplate) error
AddObjectTemplate add a global object template
func (*Yao) AddRootFunction ¶ added in v0.10.2
func (yao *Yao) AddRootFunction(name string, fn func(global map[string]interface{}, sid string, args ...interface{}) interface{}) error
AddRootFunction add a global function ( root only)
func (*Yao) Call ¶
func (yao *Yao) Call(data map[string]interface{}, name string, method string, args ...interface{}) (interface{}, error)
Call cal javascript function
func (*Yao) LoadReader ¶
LoadReader load and compile script
func (*Yao) RootCall ¶ added in v0.10.2
func (yao *Yao) RootCall(data map[string]interface{}, name string, method string, args ...interface{}) (interface{}, error)
RootCall cal javascript function
Click to show internal directories.
Click to hide internal directories.