Documentation ¶
Index ¶
- Constants
- type ABILinker
- type ExportFuncs
- func (ef *ExportFuncs) CallContract(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) 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) SendTX(offset, size 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
- type Import
- type Instance
- func (i *Instance) AddResource(ctx context.Context, data []byte) uint32
- func (i *Instance) Get(k string) int32
- func (i *Instance) GetResource(id uint32) ([]byte, bool)
- func (i *Instance) Handle(ctx context.Context, t *Task) *wasm.EventHandleResult
- func (i *Instance) HandleEvent(ctx context.Context, fn 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) Initiate(lk ABILinker, code []byte) error
- func (rt *Runtime) PutUint32Le(buf []byte, vmAddr int32, val uint32) error
- func (rt *Runtime) Read(addr, size int32) ([]byte, error)
- type Task
Constants ¶
View Source
const MaxInt = int(MaxUint >> 1)
View Source
const MaxUint = ^uint32(0)
Variables ¶
This section is empty.
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) CallContract ¶
func (ef *ExportFuncs) CallContract(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) 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) SendTX ¶
func (ef *ExportFuncs) SendTX(offset, size int32) int32
TODO: add chainID in sendtx abi TODO: make sendTX async, and add callback if possible
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
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) PutUint32Le ¶
Click to show internal directories.
Click to hide internal directories.