Documentation
¶
Index ¶
- type EngineSpec
- type WasmEngineBuilder
- func (b *WasmEngineBuilder) Build() (*models.SpecConfig, error)
- func (b *WasmEngineBuilder) MustBuild() *models.SpecConfig
- func (b *WasmEngineBuilder) WithEntrypoint(e string) *WasmEngineBuilder
- func (b *WasmEngineBuilder) WithImportModules(e []string) *WasmEngineBuilder
- func (b *WasmEngineBuilder) WithParameters(e ...string) *WasmEngineBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EngineSpec ¶
type EngineSpec struct {
// EntryModule is the target path of the input source containing the WASM code to start running.
// This target must match an InputSource target in the job spec.
EntryModule string `json:"EntryModule"`
// Entrypoint is the name of the function in the EntryModule to call to run the job.
// For WASI jobs, this will should be `_start`, but jobs can choose to call other WASM functions instead.
// Entrypoint must be a zero-parameter zero-result function.
Entrypoint string `json:"Entrypoint,omitempty"`
// Parameters contains arguments supplied to the program (i.e. as ARGV).
Parameters []string `json:"Parameters,omitempty"`
// ImportModules is a slice of target paths for WASM modules whose exports will be available as imports
// to the EntryModule. These targets must match InputSource targets in the job spec.
ImportModules []string `json:"ImportModules,omitempty"`
}
EngineSpec contains necessary parameters to execute a wasm job.
func DecodeSpec ¶
func DecodeSpec(spec *models.SpecConfig) (EngineSpec, error)
func (EngineSpec) ToMap ¶
func (c EngineSpec) ToMap() map[string]interface{}
func (EngineSpec) Validate ¶
func (c EngineSpec) Validate() error
type WasmEngineBuilder ¶ added in v1.4.0
type WasmEngineBuilder struct {
// contains filtered or unexported fields
}
func NewWasmEngineBuilder ¶ added in v1.4.0
func NewWasmEngineBuilder(entryModuleAlias string) *WasmEngineBuilder
func (*WasmEngineBuilder) Build ¶ added in v1.4.0
func (b *WasmEngineBuilder) Build() (*models.SpecConfig, error)
func (*WasmEngineBuilder) MustBuild ¶ added in v1.5.0
func (b *WasmEngineBuilder) MustBuild() *models.SpecConfig
func (*WasmEngineBuilder) WithEntrypoint ¶ added in v1.4.0
func (b *WasmEngineBuilder) WithEntrypoint(e string) *WasmEngineBuilder
func (*WasmEngineBuilder) WithImportModules ¶ added in v1.4.0
func (b *WasmEngineBuilder) WithImportModules(e []string) *WasmEngineBuilder
func (*WasmEngineBuilder) WithParameters ¶ added in v1.4.0
func (b *WasmEngineBuilder) WithParameters(e ...string) *WasmEngineBuilder
Click to show internal directories.
Click to hide internal directories.