runtime

package
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, opts Options, query string, params map[string]interface{}) ([]byte, error)

Types

type Builtin

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

func (*Builtin) Run

func (rt *Builtin) Run(ctx context.Context, query string, params map[string]interface{}) ([]byte, 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
}

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 string, params map[string]interface{}) ([]byte, 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 string, params map[string]interface{}) ([]byte, error)
}

func New

func New(opts Options) (Runtime, error)

func NewBuiltin

func NewBuiltin(opts Options) Runtime

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