baseline

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package baseline provides snapshot-based comparison for crawl results. A baseline captures the set of issues found during a crawl so that subsequent crawls can report only new or resolved issues.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(path string, result *model.CrawlResult) error

Save serialises the issues from a CrawlResult into a pretty-printed JSON baseline file at the given path.

Types

type Baseline

type Baseline struct {
	SeedURL   string        `json:"seed_url"`
	Issues    []model.Issue `json:"issues"`
	CreatedAt time.Time     `json:"created_at"`
	Version   string        `json:"version"`
}

Baseline is a snapshot of issues from a single crawl session.

func Load

func Load(path string) (*Baseline, error)

Load reads a baseline file from disk and returns the parsed Baseline.

type DiffResult

type DiffResult struct {
	New      []model.Issue `json:"new"`      // issues in current but not baseline
	Resolved []model.Issue `json:"resolved"` // issues in baseline but not current
	Existing []model.Issue `json:"existing"` // issues in both
}

DiffResult categorises issues by comparing a baseline to a current crawl.

func Diff

func Diff(baseline *Baseline, current *model.CrawlResult) *DiffResult

Diff compares a baseline snapshot against a current crawl result and classifies every issue as new, resolved, or existing. Duplicate issues (same CheckName+URL) are handled via count-based matching: if baseline has N copies and current has M copies, min(N,M) are existing, (M-N) are new (if M>N), and (N-M) are resolved (if N>M).

Jump to

Keyboard shortcuts

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