Versions in this module Expand all Collapse all v0 v0.1.1 Apr 1, 2026 Changes in this version + var F embed.FS + var HandlerError = errors.New400Response(100040004, "脚本函数handler未找到") + func AttachCrc(vm *goja.Runtime) error + func BufferToBytes(bufferVal goja.Value) ([]byte, error) + func BytesToBuffer(vm *goja.Runtime, bs []byte) (goja.Value, error) + func GetVm() (*goja.Runtime, error) + func GetVmCallback(cb Callback) (*goja.Runtime, error) + func IsBuffer(value goja.Value) bool + func IsValid(value goja.Value) bool + func Run(script string, values ...interface{}) (goja.Value, error) + func RunById(id string, values ...interface{}) (goja.Value, error) + func RunByIdAndScript(id, script string, values ...interface{}) (goja.Value, error) + type Callback func(vm *goja.Runtime) error + type Crc16 struct + func (crc *Crc16) Checksum(data []byte, poly uint16) uint16 + type Crc32 struct + func (crc *Crc32) Checksum(data []byte, poly uint32) uint32 + type Crc64 struct + func (crc *Crc64) Checksum(data []byte, poly uint64) uint64 + type CrcModbus struct + func (crc CrcModbus) Checksum(data []byte) uint16 + type JSvm struct + Handler goja.Callable + Script string + VM *goja.Runtime + func GetJsVm(id, script string) (*JSvm, error) + func NewJsVm(id, script string) (*JSvm, error) + func (j *JSvm) SetObj(key string, obj interface{}) error + type ParseResult struct + CID string + ID string + Table string + Time int64 + Values map[string]interface{} + type Parser struct + CIDKey string + IDKey string + TableKey string + TimeKey string + ValuesKey string + func NewParser() *Parser + func (p Parser) Parse(result goja.Value) ([]ParseResult, error)