Documentation ¶
Index ¶
- type FCall
- type Resolver
- func (r *Resolver) NanoTime(vm *exec.VirtualMachine) int64
- func (r *Resolver) RandomData(vm *exec.VirtualMachine) int64
- func (r *Resolver) ResolveFunc(module, field string) exec.FunctionImport
- func (r *Resolver) ResolveGlobal(module, field string) int64
- func (r *Resolver) Stub(name string) func(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValueCall(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValueGet(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValueIndex(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValueInvoke(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValueLength(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValueLoadString(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValueNew(vm *exec.VirtualMachine) int64
- func (r *Resolver) ValuePrepString(vm *exec.VirtualMachine) int64
- func (r *Resolver) WallTime(vm *exec.VirtualMachine) int64
- func (r *Resolver) WasmExit(vm *exec.VirtualMachine) int64
- func (r *Resolver) Write(vm *exec.VirtualMachine) int64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FCall ¶
type FCall struct { Method string CB int Input json.RawMessage Output json.RawMessage }
function parameters as JSON in method name to avoid unnecessary conversion logic
type Resolver ¶
type Resolver struct { Stderr bytes.Buffer BlockedCalls []FCall PendingCalls []FCall NewCalls int // contains filtered or unexported fields }
Resolver defines imports for WebAssembly modules ran in Life.
func NewResolver ¶
func NewResolver() *Resolver
func (*Resolver) RandomData ¶
func (r *Resolver) RandomData(vm *exec.VirtualMachine) int64
func (*Resolver) ResolveFunc ¶
func (r *Resolver) ResolveFunc(module, field string) exec.FunctionImport
ResolveFunc defines a set of import functions that may be called within a WebAssembly module.
func (*Resolver) ResolveGlobal ¶
ResolveGlobal defines a set of global variables for use within a WebAssembly module.
func (*Resolver) ValueGet ¶
func (r *Resolver) ValueGet(vm *exec.VirtualMachine) int64
because VM should not have business with host's memory we have a set of hardcoded pointers & values that always have consistent value across all VM hosts. We don't wanna manage garbage collection and other shit the whole point is to make minimal functionality to run GO inside life VM
func (*Resolver) ValueIndex ¶
func (r *Resolver) ValueIndex(vm *exec.VirtualMachine) int64
func (*Resolver) ValueInvoke ¶
func (r *Resolver) ValueInvoke(vm *exec.VirtualMachine) int64
this is invoked only for _makeCallbackHelper, which we don't need so we just ignore the stuff
func (*Resolver) ValueLength ¶
func (r *Resolver) ValueLength(vm *exec.VirtualMachine) int64
func (*Resolver) ValueLoadString ¶
func (r *Resolver) ValueLoadString(vm *exec.VirtualMachine) int64
func (*Resolver) ValuePrepString ¶
func (r *Resolver) ValuePrepString(vm *exec.VirtualMachine) int64