starbind

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: GPL-3.0, GPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

DO NOT EDIT: auto-generated using _scripts/gen-starlark-bindings.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeLoad

func MakeLoad() func(thread *starlark.Thread, module string) (starlark.StringDict, error)

MakeLoad returns a simple sequential implementation of module loading suitable for use in the REPL. Each function returned by MakeLoad accesses a distinct private cache.

Types

type Context

type Context interface {
	Client() *rpc2.RPCClient
	RegisterCallback(name, helpMsg string, cmdfn func(args string) (starlark.Value, error))
	CallCommand(cmdstr string) error
	Scope() api.EvalScope
	LoadConfig() api.LoadConfig
}

Context is the context in which starlark scripts are evaluated. It contains methods to call API functions, command line commands, etc.

type Env

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

Env is the environment used to evaluate starlark scripts.

func New

func New(ctx Context) *Env

New creates a new starlark binding environment.

func (*Env) Cancel

func (env *Env) Cancel()

Cancel cancels the execution of a currently running script or function.

func (*Env) Execute

func (env *Env) Execute(out io.Writer, path string, source interface{}, mainFnName string, args []interface{}, v *api.Variable) (starlark.Value, error)

Execute executes a script. Path is the name of the file to execute and source is the source code to execute. Source can be either a []byte, a string or a io.Reader. If source is nil Execute will execute the file specified by 'path'. After the file is executed if a function named mainFnName exists it will be called, passing args to it.

func (*Env) REPL

func (env *Env) REPL(out io.Writer, lineReader <-chan string, promptChan chan<- string) error

type WrappedVariable

type WrappedVariable interface {
	UnwrapVariable() *api.Variable
}

Jump to

Keyboard shortcuts

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