cmd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertParserLinks(parserLinks []parser.Link) []checker.Link

ConvertParserLinks converts a slice of parser.Link to checker.Link. This bridges the gap between the parser and checker packages.

func CountUniqueURLs added in v0.1.1

func CountUniqueURLs(links []checker.Link) int

CountUniqueURLs returns the number of unique URLs in a slice of checker.Link. This is useful for displaying progress information and deduplication stats.

func CreateFilter added in v0.1.1

func CreateFilter(opts FilterOptions) (*filter.Filter, error)

CreateFilter builds a URL filter from config file and CLI flags. If noConfig is true, the .gonerc.yaml file will not be loaded. CLI flags are merged additively with config file settings. Returns nil if no filter rules are defined.

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func FilterParserLinks(parserLinks []parser.Link, urlFilter *filter.Filter) []checker.Link

FilterParserLinks applies a URL filter to parser links and returns checker links. Links that match the filter are excluded from the result. Returns all links converted to checker.Link if urlFilter is nil.

func FilterResultsAlive added in v0.1.1

func FilterResultsAlive(results []checker.Result) []checker.Result

FilterResultsAlive returns only alive results. Pre-allocates slice capacity - alive is typically the majority (~70-80%).

func FilterResultsDead added in v0.1.1

func FilterResultsDead(results []checker.Result) []checker.Result

FilterResultsDead returns results that are dead or errored. Pre-allocates slice capacity based on expected ratio (~5-15% dead).

func FilterResultsDuplicates added in v0.1.1

func FilterResultsDuplicates(results []checker.Result) []checker.Result

FilterResultsDuplicates returns only duplicate results. Pre-allocates slice capacity based on expected ratio (~10% duplicates).

func FilterResultsWarnings added in v0.1.1

func FilterResultsWarnings(results []checker.Result) []checker.Result

FilterResultsWarnings returns results with warning status (redirect or blocked). Pre-allocates slice capacity based on expected ratio (~10-30% warnings).

func SetVersion

func SetVersion(v string)

SetVersion sets the version string (called from main).

Types

type FilterOptions added in v0.1.1

type FilterOptions struct {
	Domains  []string // Domains to ignore (includes subdomains)
	Patterns []string // Glob patterns to ignore
	Regex    []string // Regex patterns to ignore
	NoConfig bool     // Skip loading .gonerc.yaml config file
}

FilterOptions holds the configuration for creating a URL filter. This struct consolidates the filter-related flags used across commands.

Jump to

Keyboard shortcuts

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