js

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearLog

func ClearLog(fs api.FS, file string) error

func Log

func Log(fs api.FS, name string, level string, entry string) error

func Module

func Module(ctx context.Context) common.Module

func RegisterLoggers

func RegisterLoggers(vm *quickjs.VM, fs api.FS, file string) error

func RegisterModules

func RegisterModules(vm *quickjs.VM, ctx context.Context, modules iter.Seq[common.Module]) error

func RegisterSerializers

func RegisterSerializers(vm *quickjs.VM) error

func RegisterTools

func RegisterTools(vm *quickjs.VM, ctx func() context.Context, prefix string, list []common.Tool) error

Types

type Config

type Config struct {
	TotalMemory   int
	WorkerMemory  int
	DefaultMemory int
	MaxWorkers    int
	JobTimeout    time.Duration
	AsyncAfter    time.Duration
	MaxQueue      int
	MaxCallDepth  int
}

type ConfigKey

type ConfigKey struct{}

type RunArg

type RunArg struct {
	File       string          `json:"file,omitempty" description:"workspace path of the script file; set exactly one of file and code"`
	Code       string          `json:"code,omitempty" description:"script source; set exactly one of file and code"`
	Comment    string          `` /* 222-byte string literal not displayed */
	Timeout    uint            `` /* 164-byte string literal not displayed */
	Memory     uint            `` /* 209-byte string literal not displayed */
	AppendLogs bool            `json:"appendLogs,omitempty" description:"append to the existing log file instead of starting it fresh"`
	Arg        json.RawMessage `` /* 174-byte string literal not displayed */
}

type RunResult

type RunResult struct {
	Output json.RawMessage `json:"result,omitempty" description:"the script's return value"`
	Log    string          `json:"logFile" description:"workspace path of the script's log file"`
	Async  bool            `` /* 262-byte string literal not displayed */
}

type Seed

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

func NewSeed

func NewSeed(c Config) Seed

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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