Documentation ¶
Index ¶
- Variables
- type ABILinker
- type ExportFuncs
- func (ef *ExportFuncs) Abort(msgPtr int32, fileNamePtr int32, line int32, col int32)
- func (ef *ExportFuncs) ApiCall(kAddr, kSize, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) CallContract(chainID int32, offset, size int32, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) GetDB(kAddr, kSize int32, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) GetData(rid, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) GetEnv(kAddr, kSize int32, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) GetEventType(rid, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) GetSQLDB(addr, size int32, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) LinkABI(impt Import) error
- func (ef *ExportFuncs) Log(logLevel, ptr, size int32) int32
- func (ef *ExportFuncs) Seed() float64
- func (ef *ExportFuncs) SendMqttMsg(topicAddr, topicSize, msgAddr, msgSize int32) int32
- func (ef *ExportFuncs) SendTX(chainID int32, offset, size, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) SendTXWithOperator(chainID int32, offset, size, vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) SetDB(kAddr, kSize, vAddr, vSize int32) int32
- func (ef *ExportFuncs) SetData(rid, addr, size int32) int32
- func (ef *ExportFuncs) SetSQLDB(addr, size int32) int32
- func (ef *ExportFuncs) StatSubmit(vmAddrPtr, vmSizePtr int32) int32
- func (ef *ExportFuncs) Trace(msgPtr int32, _ int32, arr ...float64)
- type Import
- type Instance
- func (i *Instance) AddResource(ctx context.Context, eventType, data []byte) uint32
- func (i *Instance) GetResource(id uint32) ([]byte, bool)
- func (i *Instance) HandleEvent(ctx context.Context, fn, eventType string, data []byte) *wasm.EventHandleResult
- func (i *Instance) ID() string
- func (i *Instance) RmvResource(ctx context.Context, id uint32)
- func (i *Instance) Start(ctx context.Context) error
- func (i *Instance) State() wasm.InstanceState
- func (i *Instance) Stop(ctx context.Context) error
- type Runtime
- func (rt *Runtime) Call(name string, args ...interface{}) (interface{}, error)
- func (rt *Runtime) Copy(hostData []byte, vmAddrPtr, vmSizePtr int32) error
- func (rt *Runtime) Deinstantiate()
- func (rt *Runtime) Instantiate() error
- func (rt *Runtime) Link(lk ABILinker, code []byte) error
- func (rt *Runtime) Read(addr, size int32) ([]byte, error)
- type Task
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type ExportFuncs ¶
type ExportFuncs struct {
// contains filtered or unexported fields
}
func NewExportFuncs ¶ added in v1.0.0
func NewExportFuncs(ctx context.Context, rt *Runtime) (*ExportFuncs, error)
func (*ExportFuncs) Abort ¶ added in v1.1.0
func (ef *ExportFuncs) Abort(msgPtr int32, fileNamePtr int32, line int32, col int32)
Abort is reserved for imported func env.abort() which is auto-generated by assemblyScript
func (*ExportFuncs) ApiCall ¶ added in v1.4.2
func (ef *ExportFuncs) ApiCall(kAddr, kSize, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) CallContract ¶
func (ef *ExportFuncs) CallContract(chainID int32, offset, size int32, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) GetDB ¶
func (ef *ExportFuncs) GetDB(kAddr, kSize int32, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) GetData ¶
func (ef *ExportFuncs) GetData(rid, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) GetEnv ¶ added in v1.0.0
func (ef *ExportFuncs) GetEnv(kAddr, kSize int32, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) GetEventType ¶ added in v1.1.0
func (ef *ExportFuncs) GetEventType(rid, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) GetSQLDB ¶ added in v1.0.0
func (ef *ExportFuncs) GetSQLDB(addr, size int32, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) LinkABI ¶ added in v1.0.0
func (ef *ExportFuncs) LinkABI(impt Import) error
func (*ExportFuncs) Log ¶
func (ef *ExportFuncs) Log(logLevel, ptr, size int32) int32
func (*ExportFuncs) Seed ¶ added in v1.1.0
func (ef *ExportFuncs) Seed() float64
Seed is reserved for imported func env.seed() which is auto-generated by assemblyScript
func (*ExportFuncs) SendMqttMsg ¶ added in v1.1.0
func (ef *ExportFuncs) SendMqttMsg(topicAddr, topicSize, msgAddr, msgSize int32) int32
func (*ExportFuncs) SendTX ¶
func (ef *ExportFuncs) SendTX(chainID int32, offset, size, vmAddrPtr, vmSizePtr int32) int32
TODO: make sendTX async, and add callback if possible
func (*ExportFuncs) SendTXWithOperator ¶ added in v1.1.0
func (ef *ExportFuncs) SendTXWithOperator(chainID int32, offset, size, vmAddrPtr, vmSizePtr int32) int32
func (*ExportFuncs) SetDB ¶
func (ef *ExportFuncs) SetDB(kAddr, kSize, vAddr, vSize int32) int32
func (*ExportFuncs) SetData ¶
func (ef *ExportFuncs) SetData(rid, addr, size int32) int32
TODO SetData if rid not exist, should be assigned by wasm?
func (*ExportFuncs) SetSQLDB ¶ added in v1.0.0
func (ef *ExportFuncs) SetSQLDB(addr, size int32) int32
func (*ExportFuncs) StatSubmit ¶ added in v1.4.1
func (ef *ExportFuncs) StatSubmit(vmAddrPtr, vmSizePtr int32) int32
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
func NewInstanceByCode ¶
func (*Instance) AddResource ¶
func (*Instance) HandleEvent ¶
func (*Instance) State ¶
func (i *Instance) State() wasm.InstanceState
type Runtime ¶ added in v1.0.0
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶ added in v1.0.0
func NewRuntime() *Runtime
func (*Runtime) Deinstantiate ¶ added in v1.1.0
func (rt *Runtime) Deinstantiate()
func (*Runtime) Instantiate ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.