runtime

package
v2.0.0-alpha.6 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBrowser = "http://127.0.0.1:9222"
View Source
const DefaultRuntime = "builtin"

Variables

View Source
var ErrArtifactRequiresBuiltinRuntime = errors.New("compiled artifacts require the builtin runtime")

ErrArtifactRequiresBuiltinRuntime indicates compiled artifacts can only run on the builtin runtime.

Functions

func IsBuiltinType

func IsBuiltinType(name string) bool

func Run

func Run(ctx context.Context, opts Options, query *source.Source, params map[string]any) (io.ReadCloser, error)

func RunArtifact

func RunArtifact(ctx context.Context, opts Options, data []byte, params map[string]any) (io.ReadCloser, error)

Types

type Builtin

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

func (*Builtin) Run

func (rt *Builtin) Run(ctx context.Context, query *source.Source, params map[string]any) (io.ReadCloser, error)

func (*Builtin) RunArtifact

func (rt *Builtin) RunArtifact(ctx context.Context, data []byte, params map[string]any) (io.ReadCloser, error)

func (*Builtin) Version

func (rt *Builtin) Version(_ context.Context) (string, error)

type Options

type Options struct {
	Type                string
	Proxy               string
	UserAgent           string
	Headers             *drivers.HTTPHeaders
	Cookies             *drivers.HTTPCookies
	KeepCookies         bool
	BrowserAddress      string
	WithBrowser         bool
	WithHeadlessBrowser bool
	FileSystemRoot      string
}

func NewDefaultOptions

func NewDefaultOptions() Options

func (*Options) ToCDP

func (opts *Options) ToCDP() []cdp.Option

func (*Options) ToInMemory

func (opts *Options) ToInMemory() []http.Option

type Remote

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

func (*Remote) Run

func (rt *Remote) Run(ctx context.Context, query *source.Source, params map[string]any) (io.ReadCloser, error)

func (*Remote) RunArtifact

func (rt *Remote) RunArtifact(_ context.Context, _ []byte, _ map[string]any) (io.ReadCloser, error)

func (*Remote) Version

func (rt *Remote) Version(ctx context.Context) (string, error)

type Runtime

type Runtime interface {
	Version(ctx context.Context) (string, error)

	Run(ctx context.Context, query *source.Source, params map[string]any) (io.ReadCloser, error)
	RunArtifact(ctx context.Context, data []byte, params map[string]any) (io.ReadCloser, error)
}

func New

func New(opts Options) (Runtime, error)

func NewBuiltin

func NewBuiltin(opts Options) (Runtime, error)

func NewRemote

func NewRemote(url url.URL, opts Options) Runtime

Jump to

Keyboard shortcuts

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