capture

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserPageCapturer

type BrowserPageCapturer struct {
	PathToBrowser              *string
	Browser                    *rod.Browser
	TimeoutSeconds             int
	MinDOMStabalizeTimeSeconds int
}

func NewBrowserPageCapturer

func NewBrowserPageCapturer(pathToBrowser *string, timeout int, minDOMStabalizeTime int) *BrowserPageCapturer

func NewBrowserPageCapturerWithClient

func NewBrowserPageCapturerWithClient(client *cdp.Client, timeout int, minDOMStabalizeTime int) *BrowserPageCapturer

func (*BrowserPageCapturer) Capture

func (b *BrowserPageCapturer) Capture(ctx context.Context, url string, options *Options) (*Result, error)

func (*BrowserPageCapturer) CaptureScreenshot

func (b *BrowserPageCapturer) CaptureScreenshot(ctx context.Context, url string, options *Options) webscan.PageScreenshotReport

func (*BrowserPageCapturer) Close

func (b *BrowserPageCapturer) Close(ctx context.Context) error

func (*BrowserPageCapturer) InitializeBrowser

func (b *BrowserPageCapturer) InitializeBrowser()

type BrowserbasePageCapturer

type BrowserbasePageCapturer struct {
	Client   *browserbase.Client
	Capturer *BrowserPageCapturer
}

func NewBrowserbasePageCapturer

func NewBrowserbasePageCapturer(
	ctx context.Context,
	timeout int,
	minDOMStabalizeTime int,
	browserbaseClient *browserbase.Client,
) *BrowserbasePageCapturer

func (*BrowserbasePageCapturer) Capture

func (b *BrowserbasePageCapturer) Capture(ctx context.Context, url string, options *Options) (*Result, error)

func (*BrowserbasePageCapturer) CaptureScreenshot added in v0.0.26

func (b *BrowserbasePageCapturer) CaptureScreenshot(ctx context.Context, url string, options *Options) webscan.PageScreenshotReport

func (*BrowserbasePageCapturer) Close

type Options

type Options struct{}

type PageCapturer

type PageCapturer interface {
	Capture(ctx context.Context, url string, options *Options) (*Result, error)
	Close(ctx context.Context) error
}

type RequestPageCapturer

type RequestPageCapturer struct {
	Client http.Client
}

func NewRequestPageCapturer

func NewRequestPageCapturer(insecure bool, timeout int) *RequestPageCapturer

func (*RequestPageCapturer) Capture

func (r *RequestPageCapturer) Capture(ctx context.Context, url string, options *Options) (*Result, error)

func (*RequestPageCapturer) Close

func (r *RequestPageCapturer) Close(ctx context.Context) error

type Result

type Result struct {
	Content    []byte   `json:"content,omitempty" yaml:"content,omitempty"`
	StatusCode *int     `json:"statusCode,omitempty" yaml:"statusCode,omitempty"`
	URL        string   `json:"url,omitempty" yaml:"url,omitempty"`
	Errors     []string `json:"errors,omitempty" yaml:"errors,omitempty"`
}

func NewCaptureResult

func NewCaptureResult(URL string) *Result

func (*Result) ToPageCaptureReport

func (r *Result) ToPageCaptureReport() webscan.PageCaptureReport

type WebSocket

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

func NewWebSocket

func NewWebSocket(ctx context.Context, url string) *WebSocket

func (*WebSocket) Read

func (w *WebSocket) Read() ([]byte, error)

func (*WebSocket) Send

func (w *WebSocket) Send(b []byte) error

Jump to

Keyboard shortcuts

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