Documentation ¶
Index ¶
- Variables
- func CallApi(vm C.VMPtr, data *C.char) *C.char
- func Dispose()
- func DoHandleNoPermission(param map[string]string) (string, error)
- func DoInVm(js string, param string) (int, string, error)
- func GetVmNum(js string, count int) int
- func GoHandle(vm C.VMPtr, data *C.char) *C.char
- func GoOutput(c *C.char)
- func HttpGet(vm C.VMPtr, data *C.char) *C.char
- func HttpPost(vm C.VMPtr, url *C.char, ct *C.char, data *C.char) *C.char
- func Init(initcount int)
- func LoadAllJsFile(cvm VM, pathname string) string
- func ReadAll(filePth string) ([]byte, error)
- func ResetVm(id int) error
- func V8Init() int
- func Version() string
- type V8VM
- func (vm *V8VM) Called() int64
- func (vm *V8VM) DispatchEnter(sessionId uint64, addr string) int
- func (vm *V8VM) DispatchLeave(sessionId uint64, addr string) int
- func (vm *V8VM) DispatchMessage(sessionId uint64, msg map[interface{}]interface{}) int
- func (vm *V8VM) Dispose()
- func (vm *V8VM) Eval(js string) (string, error)
- func (vm *V8VM) GetAssociatedSourceAddr() string
- func (vm *V8VM) GetAssociatedSourceId() uint64
- func (vm *V8VM) Load(path string) (bool, string)
- func (vm *V8VM) PrintMemStat()
- func (vm *V8VM) Reset()
- func (vm *V8VM) SetAssociatedSourceAddr(addr string)
- func (vm *V8VM) SetAssociatedSourceId(id uint64)
- type VM
Constants ¶
This section is empty.
Variables ¶
View Source
var OnOutput func(string) = nil
View Source
var OnSendMessage func(string, uint64, interface{}) int = nil
View Source
var OnSendMessageTo func(interface{}) int = nil
Functions ¶
func LoadAllJsFile ¶
Types ¶
type V8VM ¶
type V8VM struct {
// contains filtered or unexported fields
}
func (*V8VM) DispatchMessage ¶
func (*V8VM) GetAssociatedSourceAddr ¶
func (*V8VM) GetAssociatedSourceId ¶
func (*V8VM) PrintMemStat ¶
func (vm *V8VM) PrintMemStat()
func (*V8VM) SetAssociatedSourceAddr ¶
func (*V8VM) SetAssociatedSourceId ¶
type VM ¶
type VM interface { Dispose() Called() int64 Reset() PrintMemStat() Load(path string) (bool, string) Eval(path string) (string, error) SetAssociatedSourceAddr(addr string) SetAssociatedSourceId(id uint64) GetAssociatedSourceAddr() string GetAssociatedSourceId() uint64 DispatchEnter(sessionId uint64, addr string) int DispatchLeave(sessionId uint64, addr string) int DispatchMessage(sessionId uint64, msg map[interface{}]interface{}) int }
func CreateV8VM ¶
func CreateV8VM() VM
Click to show internal directories.
Click to hide internal directories.