executors

package
v0.5.23 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSupportedLanguages

func GetSupportedLanguages() []string

GetSupportedLanguages returns a list of all supported languages

Types

type Executor

type Executor interface {
	// Execute runs the script in the given runtime context
	Execute(ctx context.Context, script string, runtime *runtime.Context) error

	// Language returns the language identifier for this executor
	Language() string

	// ValidateScript performs static validation of the script
	ValidateScript(script string) error
}

Executor defines the interface for all script language executors

func NewExecutor

func NewExecutor(language string) (Executor, error)

NewExecutor creates a new executor for the specified language

type JavaScriptExecutor

type JavaScriptExecutor struct{}

JavaScriptExecutor executes JavaScript code using the goja engine

func NewJavaScriptExecutor

func NewJavaScriptExecutor() *JavaScriptExecutor

NewJavaScriptExecutor creates a new JavaScript executor

func (*JavaScriptExecutor) Execute

func (e *JavaScriptExecutor) Execute(ctx context.Context, script string, rtCtx *runtime.Context) error

Execute runs the JavaScript code in the provided runtime context

func (*JavaScriptExecutor) Language

func (e *JavaScriptExecutor) Language() string

Language returns the language identifier

func (*JavaScriptExecutor) ValidateScript

func (e *JavaScriptExecutor) ValidateScript(script string) error

ValidateScript performs static validation of JavaScript code

type ShellExecutor

type ShellExecutor struct{}

ShellExecutor executes shell scripts using bash/sh

func NewShellExecutor

func NewShellExecutor() *ShellExecutor

NewShellExecutor creates a new shell executor

func (*ShellExecutor) Execute

func (s *ShellExecutor) Execute(ctx context.Context, script string, rtCtx *runtime.Context) error

Execute runs the shell script in the current working directory

func (*ShellExecutor) Language

func (s *ShellExecutor) Language() string

Language returns the language identifier

func (*ShellExecutor) ValidateScript

func (s *ShellExecutor) ValidateScript(script string) error

ValidateScript performs basic validation on the shell script

Jump to

Keyboard shortcuts

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