wasm

package
v0.3.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadModule

func LoadModule(ctx context.Context, runtime wazero.Runtime, path string) (wazero.CompiledModule, error)

func LoadRemoteModule

func LoadRemoteModule(
	ctx context.Context,
	runtime wazero.Runtime,
	provider storage.StorageProvider,
	spec model.StorageSpec,
) (wazero.CompiledModule, error)

func ValidateModuleAgainstJob

func ValidateModuleAgainstJob(
	module wazero.CompiledModule,
	job model.Spec,
	importModules ...wazero.CompiledModule,
) error

ValidateModuleAgainstJob will return an error if the passed job does not represent a valid WASM executor job or the passed module is not able to be run to fulfill the job.

func ValidateModuleAsEntryPoint

func ValidateModuleAsEntryPoint(
	module wazero.CompiledModule,
	name string,
) error

ValidateModuleAsEntryPoint returns an error if the passed module is not capable of being an entry point to a job, i.e. that it contains a function of the passed name that meets the specification of:

- the named function exists and is exported - the function takes no parameters - the function returns one i32 value (exit code)

func ValidateModuleHasFunction

func ValidateModuleHasFunction(
	module wazero.CompiledModule,
	name string,
	parameters []api.ValueType,
	results []api.ValueType,
) error

ValidateModuleHasFunction returns an error if the passed module does not contain an exported function with the passed name, parameters and return values.

func ValidateModuleImports

func ValidateModuleImports(
	module wazero.CompiledModule,
	importModules ...wazero.CompiledModule,
) error

ValidateModuleImports will return an error if the passed module requires imports that are not found in any of the passed importModules. Imports have to match exactly, i.e. function names and signatures must be an exact match.

Types

type Executor

type Executor struct {
	StorageProvider storage.StorageProvider
}

func NewExecutor

func NewExecutor(
	_ context.Context,
	storageProvider storage.StorageProvider,
) (*Executor, error)

func (*Executor) GetVolumeSize

func (e *Executor) GetVolumeSize(ctx context.Context, volume model.StorageSpec) (uint64, error)

func (*Executor) HasStorageLocally

func (e *Executor) HasStorageLocally(ctx context.Context, volume model.StorageSpec) (bool, error)

func (*Executor) IsInstalled

func (e *Executor) IsInstalled(context.Context) (bool, error)

func (*Executor) RunShard

func (e *Executor) RunShard(
	ctx context.Context,
	shard model.JobShard,
	jobResultsDir string,
) (*model.RunCommandResult, error)

Directories

Path Synopsis
funcs
http/client module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL