Versions in this module Expand all Collapse all v0 v0.2.0 Jun 20, 2026 Changes in this version + const LevelPrint + type Console struct + func (c *Console) Drain() []ConsoleEntry + func (c *Console) Len() int + type ConsoleEntry struct + Fields []ConsoleField + Level string + Message string + Time time.Time + type ConsoleField struct + Key string + Value interface{} + type Diagnostic struct + Col int + File string + Line int + Msg string + func (d Diagnostic) String() string + type GlobalSurface struct + Name string + Type string + type ModuleAllow struct + Capabilities starlet.ModuleCapability + Names []string + type ModuleOrigin string + const OriginBuiltin + const OriginCustom + const OriginDynamic + const OriginScript + type ModuleSurface struct + Members []string + Name string + Origin ModuleOrigin + type ModuleWithheldError = starlet.ModuleWithheldError + type OutputLimitExceededError struct + Count uint + Limit uint + func (e OutputLimitExceededError) Error() string + type Policy struct + Modules ModuleAllow + type RunError struct + Err error + Kind RunErrorKind + func ClassifyRunError(err error) *RunError + func (e *RunError) Error() string + func (e *RunError) Unwrap() error + type RunErrorKind int + const RunErrorCompile + const RunErrorEval + const RunErrorMaxSteps + const RunErrorModuleWithheld + const RunErrorOutputLimit + const RunErrorSyntax + const RunErrorUnknown + func (k RunErrorKind) String() string type Starbox + func NewWithPolicy(name string, p Policy) *Starbox + func (s *Starbox) AddResultBuiltin(name string) + func (s *Starbox) Check(script string) ([]Diagnostic, error) + func (s *Starbox) Console() *Console + func (s *Starbox) DescribeSurface() (Surface, error) + func (s *Starbox) EnableConsoleCapture() *Console + func (s *Starbox) GetResult() (starlark.Value, bool) + func (s *Starbox) SetMaxExecutionSteps(steps uint64) + func (s *Starbox) SetMaxOutputEntries(n uint) + type Surface struct + Globals []GlobalSurface + Modules []ModuleSurface v0.1.2 Jul 8, 2024 Changes in this version + var ErrModuleNotFound = errors.New("module not found") + type DoNotCompare [0]func() + type DynamicModuleLoader func(string) (starlet.ModuleLoader, error) type Starbox + func (s *Starbox) AddModulesByName(moduleNames ...string) + func (s *Starbox) RunFile(file string) (starlet.StringAnyMap, error) + func (s *Starbox) SetDynamicModuleLoader(loader DynamicModuleLoader) + func (s *Starbox) SetLogger(sl *zap.SugaredLogger) + func (s *Starbox) SetScriptCache(cache starlet.ByteCache) v0.1.1 May 20, 2024 Changes in this version type RunnerConfig + func (c *RunnerConfig) Clone() *RunnerConfig type Starbox + func (s *Starbox) CallStarlarkFunc(name string, args ...interface{}) (interface{}, error) v0.1.0 Apr 30, 2024 Changes in this version + var ErrNoStarbox = errors.New("no starbox instance") + var HereDoc = here.Doc + var HereDocf = here.Docf + func NewMemory() *dataconv.SharedDict + func SetLog(l *zap.SugaredLogger) + type FuncMap map[string]StarlarkFunc + type InspectCondFunc func(starlet.StringAnyMap, error) bool + type ModuleSetName string + const EmptyModuleSet + const FullModuleSet + const NetworkModuleSet + const SafeModuleSet + type RunnerConfig struct + func NewRunConfig() *RunnerConfig + func (c *RunnerConfig) Context(ctx context.Context) *RunnerConfig + func (c *RunnerConfig) Execute() (starlet.StringAnyMap, error) + func (c *RunnerConfig) FileName(name string) *RunnerConfig + func (c *RunnerConfig) Inspect(force bool) *RunnerConfig + func (c *RunnerConfig) InspectCond(cond InspectCondFunc) *RunnerConfig + func (c *RunnerConfig) KeyValue(key string, value interface{}) *RunnerConfig + func (c *RunnerConfig) KeyValueMap(extras starlet.StringAnyMap) *RunnerConfig + func (c *RunnerConfig) Script(content string) *RunnerConfig + func (c *RunnerConfig) Starbox(b *Starbox) *RunnerConfig + func (c *RunnerConfig) String() string + func (c *RunnerConfig) Timeout(timeout time.Duration) *RunnerConfig + type Starbox struct + func New(name string) *Starbox + func (s *Starbox) AddBuiltin(name string, starFunc StarlarkFunc) + func (s *Starbox) AddHTTPContext(req *http.Request) *libhttp.ServerResponse + func (s *Starbox) AddKeyStarlarkValue(key string, value starlark.Value) + func (s *Starbox) AddKeyValue(key string, value interface{}) + func (s *Starbox) AddKeyValues(keyValues starlet.StringAnyMap) + func (s *Starbox) AddModuleData(moduleName string, moduleData starlark.StringDict) + func (s *Starbox) AddModuleFunctions(name string, funcs FuncMap) + func (s *Starbox) AddModuleLoader(moduleName string, moduleLoader starlet.ModuleLoader) + func (s *Starbox) AddModuleScript(moduleName, moduleScript string) + func (s *Starbox) AddNamedModules(moduleNames ...string) + func (s *Starbox) AddStarlarkValues(keyValues starlark.StringDict) + func (s *Starbox) AddStructData(structName string, structData starlark.StringDict) + func (s *Starbox) AddStructFunctions(name string, funcs FuncMap) + func (s *Starbox) AttachMemory(name string, memory *dataconv.SharedDict) + func (s *Starbox) CreateMemory(name string) *dataconv.SharedDict + func (s *Starbox) CreateRunConfig() *RunnerConfig + func (s *Starbox) GetMachine() *starlet.Machine + func (s *Starbox) GetModuleNames() []string + func (s *Starbox) GetSteps() uint64 + func (s *Starbox) REPL() error + func (s *Starbox) Reset() + func (s *Starbox) Run(script string) (starlet.StringAnyMap, error) + func (s *Starbox) RunInspect(script string) (starlet.StringAnyMap, error) + func (s *Starbox) RunInspectIf(script string, cond InspectCondFunc) (starlet.StringAnyMap, error) + func (s *Starbox) RunTimeout(script string, timeout time.Duration) (starlet.StringAnyMap, error) + func (s *Starbox) SetFS(hfs fs.FS) + func (s *Starbox) SetModuleSet(modSet ModuleSetName) + func (s *Starbox) SetPrintFunc(printFunc starlet.PrintFunc) + func (s *Starbox) SetStructTag(tag string) + func (s *Starbox) String() string + type StarlarkFunc func(thread *starlark.Thread, fn *starlark.Builtin, args starlark.Tuple, ...) (starlark.Value, error)