Documentation
¶
Overview ¶
Package audit provides checkers that analyse crawled pages and report issues.
Index ¶
- type AccessibilityChecker
- type Checker
- type DeepStructuredDataChecker
- type ExternalLinkChecker
- type HealthChecker
- type HreflangChecker
- type ImageChecker
- type LinkChecker
- type PerformanceChecker
- type Registry
- type SEOChecker
- type SecurityChecker
- type SiteChecker
- type StructuredDataChecker
- type TLSChecker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessibilityChecker ¶
type AccessibilityChecker struct{}
AccessibilityChecker analyses pages for common accessibility issues.
func NewAccessibilityChecker ¶
func NewAccessibilityChecker() *AccessibilityChecker
NewAccessibilityChecker returns a new AccessibilityChecker.
func (*AccessibilityChecker) Name ¶
func (c *AccessibilityChecker) Name() string
Name returns the checker name.
type DeepStructuredDataChecker ¶
type DeepStructuredDataChecker struct{}
DeepStructuredDataChecker performs in-depth validation of JSON-LD structured data blocks, checking for @type presence, recognised types, and required fields per type.
func NewDeepStructuredDataChecker ¶
func NewDeepStructuredDataChecker() *DeepStructuredDataChecker
NewDeepStructuredDataChecker returns a new DeepStructuredDataChecker.
func (*DeepStructuredDataChecker) Name ¶
func (c *DeepStructuredDataChecker) Name() string
Name returns the checker name.
type ExternalLinkChecker ¶
type ExternalLinkChecker struct {
// contains filtered or unexported fields
}
ExternalLinkChecker validates external links found across all crawled pages. It implements SiteChecker because all work happens in CheckSite where external URLs are deduplicated and checked concurrently.
func NewExternalLinkChecker ¶
func NewExternalLinkChecker() *ExternalLinkChecker
NewExternalLinkChecker returns a new ExternalLinkChecker.
func (*ExternalLinkChecker) CheckSite ¶
CheckSite collects all external links from every page, deduplicates them, and checks each one concurrently with per-domain rate limiting.
func (*ExternalLinkChecker) Name ¶
func (c *ExternalLinkChecker) Name() string
Name returns the checker name.
func (*ExternalLinkChecker) SetHTTPClient ¶
func (c *ExternalLinkChecker) SetHTTPClient(client *http.Client)
SetHTTPClient sets the HTTP client used for external link checks.
type HealthChecker ¶
type HealthChecker struct{}
HealthChecker analyses pages for HTTP health issues.
func NewHealthChecker ¶
func NewHealthChecker() *HealthChecker
NewHealthChecker returns a new HealthChecker.
type HreflangChecker ¶
type HreflangChecker struct{}
HreflangChecker validates hreflang annotations per-page and across the site.
func NewHreflangChecker ¶
func NewHreflangChecker() *HreflangChecker
NewHreflangChecker returns a new HreflangChecker.
func (*HreflangChecker) Name ¶
func (c *HreflangChecker) Name() string
Name returns the checker name.
type ImageChecker ¶
type ImageChecker struct {
// contains filtered or unexported fields
}
ImageChecker analyses pages for image-related issues.
func NewImageChecker ¶
func NewImageChecker() *ImageChecker
NewImageChecker returns a new ImageChecker with a timeout-limited HTTP client.
func (*ImageChecker) SetHTTPClient ¶
func (c *ImageChecker) SetHTTPClient(client *http.Client)
SetHTTPClient sets the HTTP client used for HEAD requests.
type LinkChecker ¶
type LinkChecker struct{}
LinkChecker analyses site-wide link structure for issues.
type PerformanceChecker ¶
type PerformanceChecker struct{}
PerformanceChecker analyses pages for performance issues.
func NewPerformanceChecker ¶
func NewPerformanceChecker() *PerformanceChecker
NewPerformanceChecker returns a new PerformanceChecker.
func (*PerformanceChecker) Name ¶
func (c *PerformanceChecker) Name() string
Name returns the checker name.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered checkers and runs them.
func DefaultRegistry ¶
DefaultRegistry creates a Registry with all built-in checkers registered.
func NewRegistry ¶
NewRegistry returns an empty Registry.
func (*Registry) RunAll ¶
RunAll runs every registered checker against all pages and returns sorted issues.
Per-page checks are executed concurrently using a worker pool sized to runtime.NumCPU(). After all page checks complete, any SiteChecker's CheckSite method is called. Results are sorted by severity (critical first), then URL, then CheckName.
type SEOChecker ¶
type SEOChecker struct{}
SEOChecker analyses pages for common SEO issues.
type SecurityChecker ¶
type SecurityChecker struct{}
SecurityChecker analyses pages for missing or weak HTTP security headers.
func NewSecurityChecker ¶
func NewSecurityChecker() *SecurityChecker
NewSecurityChecker returns a new SecurityChecker.
func (*SecurityChecker) Check ¶
Check runs per-page security header checks.
Only pages with status code 200 are examined; error pages are skipped because their headers are often different from the intended configuration.
func (*SecurityChecker) CheckSite ¶
CheckSite runs site-wide security checks across all crawled pages.
func (*SecurityChecker) Name ¶
func (c *SecurityChecker) Name() string
Name returns the checker name.
type SiteChecker ¶
type SiteChecker interface {
Checker
CheckSite(ctx context.Context, pages []*model.Page) []model.Issue
}
SiteChecker extends Checker with site-wide analysis.
type StructuredDataChecker ¶
type StructuredDataChecker struct{}
StructuredDataChecker analyses pages for structured data (JSON-LD) issues.
func NewStructuredDataChecker ¶
func NewStructuredDataChecker() *StructuredDataChecker
NewStructuredDataChecker returns a new StructuredDataChecker.
func (*StructuredDataChecker) Name ¶
func (c *StructuredDataChecker) Name() string
Name returns the checker name.
type TLSChecker ¶
type TLSChecker struct {
// contains filtered or unexported fields
}
TLSChecker inspects TLS certificates of crawled HTTPS pages.