Documentation
¶
Overview ¶
Package results provides writers for several types of output.
Index ¶
- Constants
- Variables
- func FoundSomething(code int) bool
- func ReportResult(res *Result) bool
- type BaselineResult
- type CSVResultsManager
- type DiffResultsManager
- type HTMLResultsManager
- type LinkCheckResultsManager
- type LinkType
- type PlainResultsManager
- type Result
- type ResultGroupGenerator
- type ResultsManager
Constants ¶
const ( LinkHREF = LinkType(iota) LinkIMG LinkScript LinkStyle LinkUnknown )
Variables ¶
var LinkTypes = []string{
"href",
"img",
"script",
"style",
"",
}
var OutputFormats = []string{"text", "csv", "html", "diff"}
Available output formats as strings.
Functions ¶
func ReportResult ¶
Returns true if this result should be included in reports
Types ¶
type BaselineResult ¶
type BaselineResult struct {
Result
// Which properties are significant
PathSignificant bool
HeadersSignificant []string
CodeSignificant bool
}
func NewBaselineResult ¶
func NewBaselineResult(results ...Result) (*BaselineResult, error)
func (*BaselineResult) Matches ¶
func (b *BaselineResult) Matches(a *Result) bool
type CSVResultsManager ¶
type CSVResultsManager struct {
// contains filtered or unexported fields
}
CSVResultsManager writes a CSV containing all of the results.
func (*CSVResultsManager) Run ¶
func (rm *CSVResultsManager) Run(res <-chan *Result)
type DiffResultsManager ¶
type DiffResultsManager struct {
// contains filtered or unexported fields
}
func NewDiffResultsManager ¶
func NewDiffResultsManager(fp io.WriteCloser) *DiffResultsManager
func (*DiffResultsManager) AddGroup ¶
func (drm *DiffResultsManager) AddGroup(baselineResults ...Result) error
func (*DiffResultsManager) Append ¶
func (drm *DiffResultsManager) Append(result *Result)
func (*DiffResultsManager) Run ¶
func (drm *DiffResultsManager) Run(rChan <-chan *Result)
func (*DiffResultsManager) Wait ¶
func (drm *DiffResultsManager) Wait()
func (*DiffResultsManager) WriteResults ¶
func (drm *DiffResultsManager) WriteResults() error
type HTMLResultsManager ¶
type HTMLResultsManager struct {
BaseURL string
// contains filtered or unexported fields
}
HTMLResultsManager writes an HTML file containing the results.
func (*HTMLResultsManager) Run ¶
func (rm *HTMLResultsManager) Run(res <-chan *Result)
type LinkCheckResultsManager ¶
type LinkCheckResultsManager struct {
// contains filtered or unexported fields
}
Check results for broken links.
func (*LinkCheckResultsManager) Run ¶
func (rm *LinkCheckResultsManager) Run(resChan <-chan *Result)
type PlainResultsManager ¶
type PlainResultsManager struct {
// contains filtered or unexported fields
}
PlainResultsManager is designed to output a very basic output that is good for human reading, but not so good for machine parsing. This is the default output and provides a decent way to review results on-screen.
func (*PlainResultsManager) Run ¶
func (rm *PlainResultsManager) Run(res <-chan *Result)
type Result ¶
type Result struct {
// URL of resource
URL *url.URL
// Host header (if different)
Host string
// HTTP Status Code
Code int
// Error if one occurred
Error error
// Redirect URL
Redir *url.URL
// Content length
Length int64
// Content-type header
ContentType string
// Known Headers
RequestHeader http.Header
// Response headers
ResponseHeader http.Header
// Group used for potentially bucketing results
ResultGroup string
// Links contained in result
Links map[string]LinkType
}
This is the result emitted by the worker for each URL tested.
func NewResultForTask ¶
type ResultGroupGenerator ¶
var GetResultGroup ResultGroupGenerator = func(*Result) string { return "" }
type ResultsManager ¶
type ResultsManager interface {
// Run reads all of the Results in the given channel and writes them to an
// appropriate output sink. Run should start its own goroutine for the bulk
// of the work.
Run(<-chan *Result)
// Wait until the channel has been read and output done.
Wait()
}
ResultsManager provides an interface for reading results from a channel and writing them to some form of output.
func GetResultsManager ¶
func GetResultsManager(settings *ss.ScanSettings) (ResultsManager, error)
Construct a ResultsManager for the given settings in the ss.ScanSettings. Returns an object satisfying the ResultsManager interface or an error.