Documentation ¶
Overview ¶
Package parseadvisory contains core functionality for converting the advisories -- the "source of truth" for the Xen Project XSAs -- into machine-readable information.
The core function of the library is ParseAdvisory.
Index ¶
Constants ¶
const ( SectionIssueDescription = "ISSUE DESCRIPTION" SectionImpact = "IMPACT" SectionVulnerableSystems = "VULNERABLE SYSTEMS" SectionMitigation = "MITIGATION" SectionResolution = "RESOLUTION" SectionEmbargoDeployment = "DEPLOYMENT DURING EMBARGO" SectionCredits = "CREDITS" SectionPatchInformation = "PATCH INFORMATION" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Advisory ¶
type Advisory struct { Xsa int Title string Version int Deallocated bool Embargoed bool EmbargoTime time.Time Cve []string // NB Sections is a slice rather than a map so that we can reconstruct the // advisory after editing it Sections []Section Errors []error Files []FileInfo VersionTags []VersionTag }
func ParseAdvisory ¶
ParseAdvisory takes an input and attempts to parse it as an advisory. Generally speaking, errors are only returned for circumstances that prevent further processing; either IO errors, or egregious format violations which probably indicate that the wrong type of data was passed in.
More subtle errors in formating or specification compliance will be returned in a.Errors.
func (Advisory) GetSection ¶
GetSection will look for the section with the given title, and return the content as an array of lines.
type ProjectVersion ¶
type Version ¶
type Version struct {
Range []VersionSingle `parser:"@@ ( VersionDash @@ )?"`
}
type VersionSingle ¶
type VersionSingle struct { TipVersion *string `parser:"@TipVersion"` ProjectVersion *ProjectVersion `parser:"| @@"` // ProjectVersion *string `parser:"| ProjectVersionString"` Version *string `parser:"| @(VersionString | Master | RCVersionString | AltVersionString)"` }
func (VersionSingle) Project ¶
func (v VersionSingle) Project() Project
func (VersionSingle) String ¶
func (v VersionSingle) String() string
type VersionTag ¶
type VersionTag struct { Target VersionTarget `parser:"@@"` Versions []Version `parser:"ColSpacer @@ ( CommaSpacer @@ )*"` Selector *string `parser:"((Space | ColSpacer) Selector)?"` Comment *string `parser:"((Space | ColSpacer) Comment)?"` Projects []Project }