Documentation
¶
Overview ¶
Package model defines the shared data types used across the scry CLI.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CrawlResult ¶
type CrawlResult struct {
SeedURL string `json:"seed_url"`
Pages []*Page `json:"pages"`
Issues []Issue `json:"issues"`
Lighthouse []LighthouseResult `json:"lighthouse,omitempty"`
CrawledAt time.Time `json:"crawled_at"`
Duration time.Duration `json:"duration"`
}
CrawlResult is the top-level output of a crawl session.
type Issue ¶
type Issue struct {
CheckName string `json:"check_name"`
Severity Severity `json:"severity"`
Message string `json:"message"`
URL string `json:"url"`
Detail string `json:"detail,omitempty"`
}
Issue represents a single problem detected by a check.
type LighthouseResult ¶
type LighthouseResult struct {
URL string `json:"url"`
PerformanceScore float64 `json:"performance_score"`
AccessibilityScore float64 `json:"accessibility_score"`
BestPracticesScore float64 `json:"best_practices_score"`
SEOScore float64 `json:"seo_score"`
FetchedAt time.Time `json:"fetched_at"`
Source string `json:"source"`
}
LighthouseResult stores the scores returned by a Lighthouse audit.
type Page ¶
type Page struct {
URL string `json:"url"`
StatusCode int `json:"status_code"`
ContentType string `json:"content_type"`
RedirectChain []string `json:"redirect_chain,omitempty"`
Body []byte `json:"-"`
Headers http.Header `json:"headers,omitempty"`
Links []string `json:"links,omitempty"`
Assets []string `json:"assets,omitempty"`
Depth int `json:"depth"`
FetchedAt time.Time `json:"fetched_at"`
FetchDuration time.Duration `json:"fetch_duration"`
InSitemap bool `json:"in_sitemap"`
}
Page holds the fetched data and metadata for a single web page.
type Severity ¶
type Severity string
Severity represents the severity level of an issue found during a scan.
const ( // SeverityCritical indicates a critical issue that must be addressed. SeverityCritical Severity = "critical" // SeverityWarning indicates a potential problem worth investigating. SeverityWarning Severity = "warning" // SeverityInfo indicates an informational finding. SeverityInfo Severity = "info" )
func SeverityFromString ¶
SeverityFromString converts a string to a Severity, case-insensitively. It returns an empty Severity for unrecognised values.
Click to show internal directories.
Click to hide internal directories.