executor

package
v0.0.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStateNotFound = errors.New("state not found")
View Source
var ErrStatePointerRequired = errors.New("state values must be pointers")
View Source
var Modules = map[string]modules.ModuleExporterFn{
	"pgstar/postgres":        modpostgres.Constructor,
	"pgstar/http":            modhttp.Constructor,
	"pgstar/math":            modmath.Constructor,
	"pgstar/time":            modtime.Constructor,
	"pgstar/regex":           modregex.Constructor,
	"pgstar/crypto/sha2":     modsha2.Constructor,
	"pgstar/crypto/sha3":     modsha3.Constructor,
	"pgstar/crypto/random":   modrandom.Constructor,
	"pgstar/crypto/ecdsa":    modecdsa.Constructor,
	"pgstar/crypto/aes":      modaes.Constructor,
	"pgstar/encoding/base64": modbase64.Constructor,
	"pgstar/encoding/hex":    modhex.Constructor,
	"pgstar/encoding/json":   modjson.Constructor,
	"pgstar/encoding/yaml":   modyaml.Constructor,
}

Functions

func MakeStruct

func MakeStruct(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, kwargs []starlark.Tuple) (starlark.Value, error)

func PrintLog

func PrintLog(thread *starlark.Thread, msg string)

Types

type ManagedThread

type ManagedThread struct {
	*starlark.Thread
	// contains filtered or unexported fields
}

func NewManagedThread

func NewManagedThread(rootdir, starfile string) *ManagedThread

func (*ManagedThread) Exec

func (mt *ManagedThread) Exec() (starlark.StringDict, error)

func (*ManagedThread) GetRootdir

func (mt *ManagedThread) GetRootdir() string

func (*ManagedThread) GetStarfile

func (mt *ManagedThread) GetStarfile() string

func (*ManagedThread) NewChild

func (mt *ManagedThread) NewChild(starfile string) *ManagedThread

func (*ManagedThread) Predeclare

func (mt *ManagedThread) Predeclare(name string, value starlark.Value)

func (*ManagedThread) SetModuleLoader

func (mt *ManagedThread) SetModuleLoader(loader *ModuleLoader)

type ModuleLoader

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

func NewModuleLoader

func NewModuleLoader(mt *ManagedThread, rootdir, starfile string) *ModuleLoader

NewModuleLoader creates a root level ModuleLoader

func (*ModuleLoader) Destroy

func (loader *ModuleLoader) Destroy()

func (*ModuleLoader) GetState

func (loader *ModuleLoader) GetState(name string, dest any) error

GetState can be called by modules to acquire the current state value

func (*ModuleLoader) GetThreadName

func (loader *ModuleLoader) GetThreadName() string

func (*ModuleLoader) Load

func (loader *ModuleLoader) Load(thread *starlark.Thread, modulePath string) (starlark.StringDict, error)

Load handles loading script modules

func (*ModuleLoader) NewChild

func (loader *ModuleLoader) NewChild(module string) *ModuleLoader

NewChild returns a ModuleLoader child that shares the parent state and tracks the parent hierarchy to prevent recursive loading

func (*ModuleLoader) SetState

func (loader *ModuleLoader) SetState(name string, ref any) error

SetState can be called by modules to update a state

Jump to

Keyboard shortcuts

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