fpcheck

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BrowserNavigator

type BrowserNavigator interface {
	Navigate(ctx context.Context, URL string) (*rod.Page, error)
}

BrowserNavigator is the minimal browser contract used by fpcheck runner.

type Detection

type Detection struct {
	Detected    bool     `json:"detected"`
	Description string   `json:"description"`
	Severity    string   `json:"severity,omitempty"`
	Numeric     *float64 `json:"numeric,omitempty"`
}

Detection represents a single anti-bot signal verdict from a detector page.

type Detector

type Detector interface {
	Name() string
	URL() string
	Extract(ctx context.Context, page *rod.Page) (map[string]Detection, string, error)
}

Detector knows how to extract normalized anti-bot verdicts from one site.

type Report

type Report struct {
	DetectorName  string               `json:"detector_name"`
	URL           string               `json:"url"`
	CapturedAtUTC string               `json:"captured_at_utc"`
	Screenshot    string               `json:"screenshot_path"`
	Detections    map[string]Detection `json:"detections"`
	Summary       Summary              `json:"summary"`
	RawNotes      string               `json:"raw_notes,omitempty"`
}

Report is the normalized output for one detector run.

func Run

func Run(ctx context.Context, browser BrowserNavigator, detector Detector, artifactDir string) (Report, error)

Run navigates the given browser to detector URL, extracts verdicts, captures a screenshot artifact, and returns a normalized report.

func RunWithOptions

func RunWithOptions(ctx context.Context, browser BrowserNavigator, detector Detector, options RunOptions) (Report, error)

RunWithOptions navigates the given browser to detector URL, extracts verdicts, captures a screenshot artifact, optionally waits, and returns a normalized report.

type RunOptions

type RunOptions struct {
	ArtifactDir     string
	WaitBeforeClose time.Duration
}

RunOptions controls detector run behavior.

type Summary

type Summary struct {
	Passed   int      `json:"passed"`
	Failed   int      `json:"failed"`
	Critical []string `json:"critical,omitempty"`
}

Summary contains aggregate counters for a detector report.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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