Documentation
¶
Index ¶
- func FromExtismLoader(logHandler slog.Handler, ldr loader.Loader, entryPoint string) (*evaluator.Evaluator, error)
- func FromExtismLoaderWithData(logHandler slog.Handler, ldr loader.Loader, staticData map[string]any, ...) (*evaluator.Evaluator, error)
- func NewCompiler(opts ...compiler.FunctionalOption) (*compiler.Compiler, error)
- func NewEvaluator(logHandler slog.Handler, ldr loader.Loader, dataProvider data.Provider, ...) (*evaluator.Evaluator, error)
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.