compile

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCompileFailed = errors.New("failed to load wasm binary")
	ErrContentNil    = errors.New("wasm content is nil")
	ErrInvalidBinary = errors.New("invalid WASM binary (must be base64 encoded)")
)

Functions

func CompileBase64

func CompileBase64(
	ctx context.Context,
	scriptContent string,
	opts *Settings,
) (adapters.CompiledPlugin, error)

CompileBase64 creates a compiled Extism plugin from base64-encoded WASM content

func CompileBytes

func CompileBytes(
	ctx context.Context,
	wasmBytes []byte,
	opts *Settings,
) (adapters.CompiledPlugin, error)

CompileBytes creates a compiled Extism plugin from raw WASM bytes

Types

type Settings

type Settings struct {
	// EnableWASI enables WASI support in the plugin
	EnableWASI bool
	// RuntimeConfig allows customizing the wazero runtime configuration
	RuntimeConfig wazero.RuntimeConfig
	// HostFunctions are additional host functions to be registered with the plugin
	HostFunctions []extismSDK.HostFunction
}

Settings holds configuration for compiling a WASM module

func WithDefaultCompileSettings

func WithDefaultCompileSettings() *Settings

WithDefaultCompileSettings returns the default compilation options

Jump to

Keyboard shortcuts

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