starlarkengine

package
v0.0.0-...-bb8a427 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MPL-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidClientReq is returned when the client request could not be made
	ErrInvalidClientReq errInvalidClientReq
	// ErrSendClientReq is returned when failing to send the client request
	ErrSendClientReq errSendClientReq
	// ErrInvalidServerRes is returned on an invalid server response
	ErrInvalidServerRes errInvalidServerRes
	// ErrServerRes is a returned server error
	ErrServerRes errServerRes
)
View Source
var ErrImportCycle errImportCycle

ErrImportCycle is returned when module dependencies form a cycle

View Source
var ErrNoRuntimeLoad errNoRuntimeLoad

ErrNoRuntimeLoad is returned when attempting to load modules not ata the top level

Functions

This section is empty.

Types

type Builder

type Builder []Opt

func (Builder) Build

func (b Builder) Build(fsys fs.FS) (workflowengine.WorkflowEngine, error)

type Engine

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

Engine is a starlark workflow engine

func New

func New(fsys fs.FS, opts ...Opt) *Engine

func (*Engine) Exec

func (e *Engine) Exec(ctx context.Context, events *workflowengine.EventHistory, name string, args map[string]any, stderr io.Writer) (any, error)

type NativeFunc

type NativeFunc struct {
	Mod    string
	Name   string
	Fn     func(ctx context.Context, args []any) (any, error)
	Params []string
}

NativeFunc is a starlark function implemented in go

type Opt

type Opt = func(e *Engine)

func OptHttpClientTimeout

func OptHttpClientTimeout(t time.Duration) Opt

func OptHttpClientTransport

func OptHttpClientTransport(t http.RoundTripper) Opt

func OptLibName

func OptLibName(name string) Opt

func OptNativeFuncs

func OptNativeFuncs(fns []NativeFunc) Opt

Jump to

Keyboard shortcuts

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