extism

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromExtismLoader

func FromExtismLoader(
	logHandler slog.Handler,
	ldr loader.Loader,
	entryPoint string,
) (*evaluator.Evaluator, error)

FromExtismLoader creates an Extism evaluator from a loader with dynamic data only (ContextProvider)

Input parameters: - l: loader implementation for loading the WASM content - logHandler: logger handler for logging - entryPoint: entry point for the WASM module (which function to call in the WASM file)

Returns an evaluator, which implements the evaluation.Evaluator interface.

func FromExtismLoaderWithData

func FromExtismLoaderWithData(
	logHandler slog.Handler,
	ldr loader.Loader,
	staticData map[string]any,
	entryPoint string,
) (*evaluator.Evaluator, error)

FromExtismLoaderWithData creates an Extism evaluator with both static and dynamic data capabilities.

Input parameters: - l: loader implementation for loading the WASM content - staticData: map of initial static data to be passed to the WASM module - logHandler: logger handler for logging - entryPoint: entry point for the WASM module (which function to call in the WASM file)

Returns an evaluator, which implements the evaluation.Evaluator interface.

func NewCompiler

func NewCompiler(opts ...compiler.FunctionalOption) (*compiler.Compiler, error)

NewCompiler creates a new Extism compiler using the functional options pattern. Returns a compiler implementing the script.Compiler interface.

func NewEvaluator

func NewEvaluator(
	logHandler slog.Handler,
	ldr loader.Loader,
	dataProvider data.Provider,
	entryPoint string,
) (*evaluator.Evaluator, error)

NewEvaluator creates an Extism evaluator with WASM code loaded, and ready for execution. Returns a Evaluator, which implements the evaluation.Evaluator interface.

Types

This section is empty.

Directories

Path Synopsis
The adapters for the Extism SDK types that wrap the SDK's concrete types are defined here.
The adapters for the Extism SDK types that wrap the SDK's concrete types are defined here.

Jump to

Keyboard shortcuts

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