Documentation ¶
Index ¶
- Variables
- func MakeStruct(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)
- func PrintLog(thread *starlark.Thread, msg string)
- type ManagedThread
- func (mt *ManagedThread) Exec() (starlark.StringDict, error)
- func (mt *ManagedThread) GetRootdir() string
- func (mt *ManagedThread) GetStarfile() string
- func (mt *ManagedThread) NewChild(starfile string) *ManagedThread
- func (mt *ManagedThread) Predeclare(name string, value starlark.Value)
- func (mt *ManagedThread) SetModuleLoader(loader *ModuleLoader)
- type ModuleLoader
- func (loader *ModuleLoader) Destroy()
- func (loader *ModuleLoader) GetState(name string, dest any) error
- func (loader *ModuleLoader) GetThreadName() string
- func (loader *ModuleLoader) Load(thread *starlark.Thread, modulePath string) (starlark.StringDict, error)
- func (loader *ModuleLoader) NewChild(module string) *ModuleLoader
- func (loader *ModuleLoader) SetState(name string, ref any) error
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 ¶
Types ¶
type ManagedThread ¶
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
Click to show internal directories.
Click to hide internal directories.