scripting

package
v0.0.0-...-96442b9 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scripting provides functionality for discovering and loading Lua scripts used for customization and extension of divekit operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverAvailableLanguages

func DiscoverAvailableLanguages() []string

DiscoverAvailableLanguages scans the user-level scripts directory (e.g., ~/.divekit/scripts) for language pack directories and returns their names. The hooks, lua and run directories are not packs. If no packs can be discovered, it falls back to a sensible default (currently: ["java"]).

func ScriptDir

func ScriptDir() (string, error)

ScriptDir returns the global scripts directory path

Types

type Error

type Error struct {
	apperror.Carrier
	ErrorType ErrorType
	Message   string
	Err       error
	// Limit is the time limit a timeout ran into. It is zero for other errors.
	Limit time.Duration
}

Error represents a scripting error with type and optional wrapped error

func NewHookExecutionError

func NewHookExecutionError(err error) *Error

NewHookExecutionError creates an error for hook execution failures.

func NewLoadScriptDirectoryError

func NewLoadScriptDirectoryError() *Error

NewLoadScriptDirectoryError reports a language-pack path that is a file.

func NewLoadScriptError

func NewLoadScriptError(err error) *Error

NewLoadScriptError creates an error for script loading failures.

func NewRegistrationError

func NewRegistrationError(err error) *Error

NewRegistrationError creates an error for registration failures.

func NewSandboxViolationError

func NewSandboxViolationError(details string, err error) *Error

NewSandboxViolationError creates an error for sandbox violations.

func NewScriptNotFoundError

func NewScriptNotFoundError(path string) *Error

NewScriptNotFoundError creates an error for missing script.

func NewTimeoutError

func NewTimeoutError(limit time.Duration, err error) *Error

NewTimeoutError creates an error for a script that ran past its limit. It is not a sandbox violation: the script did nothing it was not allowed to.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error

type ErrorType

type ErrorType int

ErrorType defines domain-based error categories for the scripting package.

const (
	// ErrScript indicates script loading or execution errors.
	ErrScript ErrorType = iota
	// ErrSecurity indicates sandbox or security violations.
	ErrSecurity
	// ErrNotFound indicates missing scripts.
	ErrNotFound
	// ErrTimeout indicates a script or callback that ran past its time limit.
	ErrTimeout
)

Directories

Path Synopsis
Package contracts defines interfaces for scripting and transformation operations.
Package contracts defines interfaces for scripting and transformation operations.
Package lua provides Lua scripting engine integration
Package lua provides Lua scripting engine integration

Jump to

Keyboard shortcuts

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