starlark

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromStarlarkLoader

func FromStarlarkLoader(
	logHandler slog.Handler,
	ldr loader.Loader,
) (*evaluator.Evaluator, error)

FromStarlarkLoader creates a Starlark evaluator from a loader with dynamic data only (ContextProvider)

Input parameters: - logHandler: logger handler for logging - ldr: loader implementation for loading the Starlark script content

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

func FromStarlarkLoaderWithData

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

FromStarlarkLoaderWithData creates a Starlark evaluator with both static and dynamic data capabilities.

Input parameters: - logHandler: logger handler for logging - ldr: loader implementation for loading the Starlark 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 Starlark 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 Starlark evaluator with bytecode loaded, and ready for execution. Returns a Evaluator, which implements the evaluation.Evaluator interface.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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