Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(name string, driver NewInstanceCreatorFunc)
Register makes a wasm driver available by the provided name
Types ¶
type ContractCodeProvider ¶
type ContractCodeProvider interface { GetContractCodeDesc(name string) (*pb.WasmCodeDesc, error) GetContractCode(name string) ([]byte, error) }
ContractCodeProvider provides source code and desc of contract
type InstanceCreator ¶
type InstanceCreator interface { // CreateInstance instances a wasm virtual machine instance which can run a single contract call CreateInstance(ctx *bridge.Context, cp ContractCodeProvider) (Instance, error) RemoveCache(name string) }
InstanceCreator is the creator of wasm virtual machine instance
func Open ¶
func Open(name string, config *InstanceCreatorConfig) (InstanceCreator, error)
Open opens a wasm virtual machine specified by its driver name
type InstanceCreatorConfig ¶
type InstanceCreatorConfig struct { Basedir string SyscallService *bridge.SyscallService // VMConfig is the config of vm driver VMConfig interface{} DebugLogger *log.Logger }
InstanceCreatorConfig configures InstanceCreator
type NewInstanceCreatorFunc ¶
type NewInstanceCreatorFunc func(config *InstanceCreatorConfig) (InstanceCreator, error)
NewInstanceCreatorFunc instances a new InstanceCreator from InstanceCreatorConfig
Click to show internal directories.
Click to hide internal directories.