js

package
v0.39.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Module(
	"vef:js",
	fx.Provide(
		fx.Annotate(
			func(bus event.Bus, db orm.DB, kind config.DBKind, appLibs []js.Lib) (*js.Engine, error) {
				return NewEngine(logger, bus, db, kind, appLibs)
			},
			fx.ParamTags(``, ``, ``, `group:"vef:js:libs"`),
		),
	),
)

Module wires the JavaScript scripting engine: the framework capability libraries are seeded at safe defaults across two tiers — the safe utilities (console, crypto, cache) are always installed, while the side-effecting capabilities (events, http, sql) stay opt-in per runtime — and any application library (group "vef:js:libs", registered via vef.ProvideJSLib) overrides a same-named default (keeping its tier) or adds a new opt-in library.

Functions

func NewEngine

func NewEngine(logger logx.Logger, bus event.Bus, db orm.DB, kind config.DBKind, appLibs []js.Lib) (*js.Engine, error)

NewEngine builds the application-wide engine, seeding the always-on utility libraries and the opt-in capability libraries at safe defaults, then overlaying the application-provided libraries. logger receives the script console output.

Types

This section is empty.

Jump to

Keyboard shortcuts

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