Documentation
¶
Index ¶
- func FromRisorLoader(logHandler slog.Handler, ldr loader.Loader) (*evaluator.Evaluator, error)
- func FromRisorLoaderWithData(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 FromRisorLoader ¶
FromRisorLoader creates a Risor evaluator from a loader with dynamic data only (ContextProvider)
Input parameters: - logHandler: logger handler for logging - ldr: loader implementation for loading the Risor script content
Returns an evaluator, which implements the evaluation.Evaluator interface.
func FromRisorLoaderWithData ¶
func FromRisorLoaderWithData( logHandler slog.Handler, ldr loader.Loader, staticData map[string]any, ) (*evaluator.Evaluator, error)
FromRisorLoaderWithData creates a Risor evaluator with both static and dynamic data capabilities.
Input parameters: - logHandler: logger handler for logging - ldr: loader implementation for loading the Risor script content - staticData: map of initial static data to be passed to the script
Returns an evaluator, which implements the evaluation.Evaluator interface.
func NewCompiler ¶
func NewCompiler(opts ...compiler.FunctionalOption) (*compiler.Compiler, error)
NewCompiler creates a new Risor 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, ) (*evaluator.Evaluator, error)
NewEvaluator creates a Risor evaluator with bytecode loaded, and ready for execution. Returns a Evaluator, which implements the evaluation.Evaluator interface.
Types ¶
This section is empty.