Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultHostname = "example.com" DefaultMaxProcs = 1 DefaultMaxMin = 5 DefaultMaxWorkers = 4 )
Variables ¶
This section is empty.
Functions ¶
func PrintUsageAndExit ¶
func PrintUsageAndExit()
PrintUsageAndExit is used to print out command line options.
func PrintVersionAndExit ¶
func PrintVersionAndExit()
PrintVersionAndExit prints the version of the scanner then exits.
Types ¶
type Scanner ¶
type Scanner struct { RootURL *url.URL // The original URL that we started the scan from. Tests map[string]map[string]*Stats // URL test results go in here. MaxRunMin int // The Maximum number of minutes we want the scanner to run. MaxWorkers int // The maximumm job workers we want in the pool. StartTime time.Time // When the scanner started runnning. ExpireTime time.Time // The expire time: when the scanner should stop running. EndTime time.Time // When the scanner ended. // contains filtered or unexported fields }
Scanner is a manager of scanning jobs and evaluates the results of the workers.
type Stats ¶
type Stats struct { URL *url.URL `json:"url"` // The URL we scanned. URLType string `json:"urlType"` // The type of url ex: html, img, css, js etc.. ParentURL *url.URL `json:"parentURL"` // The parent where this was located. StartTime time.Time `json:"startTime"` // The start time of the scan. EndTime time.Time `json:"endTime"` // The end time of the scan. Canonical bool `json:"canonical"` // Did this page contain a canonical link? MetaCount int `json:"metaCount"` // Does meta description exist on the page? MetaSizedErr bool `json:"metaSizedErr"` // Are meta descriptions the proper size? TitleCount int `json:"titleCount"` // Does title exist on the page? TitleSizedErr bool `json:"titleSizedErr"` // Does the title meet size criteria? AltTagsErr bool `json:"altTagsErr"` // Did alt tags exist for all images on this page? H1Count int `json:"h1Count"` // Does an h1 tag exist on the page and is it unique? StatusCode int `json:"status"` // The status code we returned from the scan. }
Stats is a construct that hold information on the scanning of a URL.
Click to show internal directories.
Click to hide internal directories.