platform

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvalOnly

type EvalOnly interface {
	// Eval evaluates the pre-compiled script with data from the context.
	// The script and its configuration were provided during evaluator creation.
	// Runtime data is retrieved using the ExecutableUnit's DataProvider.
	//
	// This design encourages the "compile once, run many times" pattern,
	// where script compilation (expensive) is separated from execution (inexpensive).
	// For dynamic data, use a ContextProvider with the constants.EvalData key.
	Eval(ctx context.Context) (EvaluatorResponse, error)
}

EvalOnly is the interface for the generic code evaluator.

type Evaluator

type Evaluator interface {
	EvalOnly
	data.Setter
}

Evaluator combines the EvalOnly and EvalDataPreparer interfaces, providing a unified API for data preparation and script evaluation. It allows these steps to be performed separately while maintaining their logical connection, supporting distributed processing architectures.

type EvaluatorResponse

type EvaluatorResponse interface {
	// Type of the object.
	Type() data.Types

	// Inspect returns a string representation of the given object.
	Inspect() string

	// Interface converts the given object to a native Go value.
	Interface() any

	// GetScriptExeID returns the ID of the script that generated the object.
	GetScriptExeID() string

	// GetExecTime returns the time it took to execute the script
	GetExecTime() string
}

EvaluatorResponse is based on the risor object.Object interface, but with some features removed

Directories

Path Synopsis
Description: This file contains constants used for accessing values from context objects.
Description: This file contains constants used for accessing values from context objects.
loader
Package loader provides implementations of the Loader interface for various source types.
Package loader provides implementations of the Loader interface for various source types.
loader/httpauth
Package httpauth provides authentication strategies for HTTP requests in go-polyscript.
Package httpauth provides authentication strategies for HTTP requests in go-polyscript.

Jump to

Keyboard shortcuts

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