Documentation
¶
Overview ¶
Package engine provides execution engines for running site scripts. It supports a fallback chain: QuickJS (fast, no browser) → CDP Browser (full browser).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Browser ¶
type Browser struct {
// contains filtered or unexported fields
}
Browser executes scripts in a real Chrome browser via CDP.
func NewBrowser ¶
NewBrowser creates a new Browser engine backed by the given transport.
type Engine ¶
type Engine interface {
// Run executes a script with the given arguments.
Run(ctx context.Context, s *script.Script, args map[string]string) (any, error)
// Name returns the engine name for logging.
Name() string
// Close releases resources held by the engine.
Close() error
}
Engine can execute a site script with arguments and return a JSON-compatible result.
type QuickJS ¶
type QuickJS struct {
// contains filtered or unexported fields
}
QuickJS executes scripts in an embedded QuickJS runtime with a Go-backed fetch().
func NewQuickJS ¶
NewQuickJS creates a new QuickJS engine backed by the given transport.
Click to show internal directories.
Click to hide internal directories.