plugin

package
v0.0.0-...-2561a70 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeHash

func ComputeHash(code string, stateSig string) string

ComputeHash computes the SHA256 hash of the user source code and the visible symbols/types.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache manages the registry of compiled plugins identified by a SHA256 hash.

func NewCache

func NewCache() *Cache

NewCache creates a new plugin cache.

func (*Cache) Get

func (c *Cache) Get(hash string) (string, bool)

Get looks up a compiled .so file path for a given hash.

func (*Cache) Put

func (c *Cache) Put(hash string, soPath string)

Put associates a hash with the compiled .so file path.

type Loader

type Loader struct{}

Loader dynamically loads a .so file and extracts the Execute symbol.

func NewLoader

func NewLoader() *Loader

NewLoader creates a new plugin loader.

func (*Loader) LoadAndExecute

func (l *Loader) LoadAndExecute(soPath string, ctx *runtime.Context) (err error)

LoadAndExecute opens the .so file, guards its execution with recover(), and calls Execute(ctx).

type PanicError

type PanicError struct {
	Value         any
	GeneratedFile string
	GeneratedLine int
}

PanicError describes a panic recovered from a cell's Execute. GeneratedLine, when non-zero, is the line in the compiled plugin's own generated main.go where the panic actually occurred (the innermost stack frame whose file is that plugin's main.go) -- session-level code, which is the only place that knows how GeneratePluginCode mapped this specific cell's lines to that file, is responsible for translating it back to the cell's own line number.

func (*PanicError) Error

func (e *PanicError) Error() string

Jump to

Keyboard shortcuts

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