Documentation ¶
Index ¶
- type Address
- func (a *Address) WithAbsoluteAddress(absoluteAddress int) *Address
- func (a *Address) WithFullyQualifiedName(fullyQualifiedName string) *Address
- func (a *Address) WithIndex(index int) *Address
- func (a *Address) WithKind(kind string) *Address
- func (a *Address) WithLength(length int) *Address
- func (a *Address) WithName(name string) *Address
- func (a *Address) WithOffsetFromParent(offsetFromParent int) *Address
- func (a *Address) WithParentIndex(parentIndex int) *Address
- func (a *Address) WithRelativeAddress(relativeAddress int) *Address
- type Artifact
- func (a *Artifact) WithContents(artifactContent *ArtifactContent) *Artifact
- func (a *Artifact) WithDescription(message *Message) *Artifact
- func (a *Artifact) WithEncoding(encoding string) *Artifact
- func (a *Artifact) WithHashes(hashes map[string]string) *Artifact
- func (a *Artifact) WithLastModifiedTimeUtc(lastModified string) *Artifact
- func (a *Artifact) WithLength(length int) *Artifact
- func (a *Artifact) WithLocation(artifactLocation *ArtifactLocation) *Artifact
- func (a *Artifact) WithMimeType(mimeType string) *Artifact
- func (a *Artifact) WithOffset(offset int) *Artifact
- func (a *Artifact) WithParentIndex(parentIndex int) *Artifact
- func (a *Artifact) WithRole(role string) *Artifact
- func (a *Artifact) WithSourceLanguage(sourceLanguage string) *Artifact
- type ArtifactChange
- type ArtifactContent
- type ArtifactLocation
- type Fix
- type Invocation
- func (i *Invocation) WithEndTimeUTC(endTime time.Time) *Invocation
- func (i *Invocation) WithStartTimeUTC(startTime time.Time) *Invocation
- func (i *Invocation) WithToolExecutionNotifications(notification *Notification) *Invocation
- func (i *Invocation) WithWorkingDirectory(workingDirectory *ArtifactLocation) *Invocation
- type Location
- func (l *Location) WithAnnotation(region *Region) *Location
- func (l *Location) WithId(id int) *Location
- func (l *Location) WithMessage(message *Message) *Location
- func (l *Location) WithPhysicalLocation(physicalLocation *PhysicalLocation) *Location
- func (l *Location) WithRelationship(locationRelationship *LocationRelationship) *Location
- type LocationRelationship
- type LogicalLocation
- func (l *LogicalLocation) WithDecoratedName(decoratedName string) *LogicalLocation
- func (l *LogicalLocation) WithFullyQualifiedName(fullyQualifiedName string) *LogicalLocation
- func (l *LogicalLocation) WithIndex(index int) *LogicalLocation
- func (l *LogicalLocation) WithKind(kind string) *LogicalLocation
- func (l *LogicalLocation) WithName(name string) *LogicalLocation
- func (l *LogicalLocation) WithParentIndex(parentIndex int) *LogicalLocation
- type Message
- type MultiformatMessageString
- type Notification
- func (n *Notification) AttachPropertyBag(pb *PropertyBag)
- func (n *Notification) WithLevel(level string) *Notification
- func (n *Notification) WithLocation(location *Location) *Notification
- func (n *Notification) WithMessage(message *Message) *Notification
- func (n *Notification) WithProperties(properties Properties) *Notification
- type PhysicalLocation
- func (pl *PhysicalLocation) WithAddress(address *Address) *PhysicalLocation
- func (pl *PhysicalLocation) WithArtifactLocation(artifactLocation *ArtifactLocation) *PhysicalLocation
- func (pl *PhysicalLocation) WithContextRegion(contextRegion *Region) *PhysicalLocation
- func (pl *PhysicalLocation) WithRegion(region *Region) *PhysicalLocation
- type Properties
- type PropertyBag
- type Region
- func (r *Region) WithByteLength(byteLength int) *Region
- func (r *Region) WithByteOffset(byteOffset int) *Region
- func (r *Region) WithCharLength(charLength int) *Region
- func (r *Region) WithCharOffset(charOffset int) *Region
- func (r *Region) WithEndColumn(endColumn int) *Region
- func (r *Region) WithEndLine(endLine int) *Region
- func (r *Region) WithMessage(message *Message) *Region
- func (r *Region) WithSnippet(snippet *ArtifactContent) *Region
- func (r *Region) WithSourceLanguage(sourceLanguage string) *Region
- func (r *Region) WithStartColumn(startColumn int) *Region
- func (r *Region) WithStartLine(startLine int) *Region
- type Replacement
- type Report
- type ReportingConfiguration
- type ReportingDescriptor
- func (rule *ReportingDescriptor) AttachPropertyBag(pb *PropertyBag)
- func (rule *ReportingDescriptor) WithDescription(description string) *ReportingDescriptor
- func (rule *ReportingDescriptor) WithFullDescription(description *MultiformatMessageString) *ReportingDescriptor
- func (rule *ReportingDescriptor) WithHelp(helpText string) *ReportingDescriptor
- func (rule *ReportingDescriptor) WithHelpURI(helpURI string) *ReportingDescriptor
- func (rule *ReportingDescriptor) WithMarkdownHelp(markdownText string) *ReportingDescriptor
- func (rule *ReportingDescriptor) WithName(name string) *ReportingDescriptor
- func (rule *ReportingDescriptor) WithProperties(properties Properties) *ReportingDescriptor
- func (rule *ReportingDescriptor) WithShortDescription(description *MultiformatMessageString) *ReportingDescriptor
- type ReportingDescriptorReference
- func (r *ReportingDescriptorReference) WithGuid(guid string) *ReportingDescriptorReference
- func (r *ReportingDescriptorReference) WithId(id string) *ReportingDescriptorReference
- func (r *ReportingDescriptorReference) WithIndex(index int) *ReportingDescriptorReference
- func (r *ReportingDescriptorReference) WithToolComponentReference(toolComponentRef *ToolComponentReference) *ReportingDescriptorReference
- type Result
- func (r *Result) AttachPropertyBag(pb *PropertyBag)
- func (r *Result) WithAnalysisTarget(target *ArtifactLocation) *Result
- func (r *Result) WithBaselineState(state string) *Result
- func (r *Result) WithCorrelationGuid(correlationGuid string) *Result
- func (r *Result) WithFingerPrints(fingerPrints map[string]interface{}) *Result
- func (r *Result) WithFix(fix *Fix) *Result
- func (r *Result) WithGuid(guid string) *Result
- func (r *Result) WithHostedViewerUri(hostedViewerUri string) *Result
- func (r *Result) WithKind(kind string) *Result
- func (r *Result) WithLevel(level string) *Result
- func (r *Result) WithLocation(location *Location) *Result
- func (r *Result) WithMessage(message *Message) *Result
- func (r *Result) WithOccurrenceCount(occurrenceCount int) *Result
- func (r *Result) WithPartialFingerPrints(fingerPrints map[string]interface{}) *Result
- func (r *Result) WithProperties(properties Properties) *Result
- func (r *Result) WithRank(rank float32) *Result
- func (r *Result) WithRelatedLocation(location *Location) *Result
- func (r *Result) WithRule(rdp *ReportingDescriptorReference) *Result
- func (r *Result) WithRuleIndex(ruleIndex int) *Result
- func (r *Result) WithSuppression(suppression *Suppression) *Result
- func (r *Result) WithTaxa(rdp *ReportingDescriptorReference) *Result
- func (r *Result) WithWorkItemUri(workItemUri string) *Result
- type Run
- func (run *Run) AddArtifact() *Artifact
- func (run *Run) AddDistinctArtifact(uri string) *Artifact
- func (run *Run) AddInvocation(executionSuccessful bool) *Invocation
- func (run *Run) AddProperty(key string, value cty.Value)
- func (run *Run) AddResult(ruleID string) *Result
- func (run *Run) AddRule(ruleID string) *ReportingDescriptor
- func (run *Run) AttachPropertyBag(pb *PropertyBag)
- func (run *Run) DedupeArtifacts() error
- func (run *Run) GetResultByRuleId(ruleId string) (*Result, error)
- func (run *Run) GetRuleById(ruleId string) (*ReportingDescriptor, error)
- type RunOption
- type Suppression
- type Tool
- type ToolComponent
- type ToolComponentReference
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { PropertyBag Index *uint `json:"index,omitempty"` AbsoluteAddress *uint `json:"absoluteAddress,omitempty"` RelativeAddress *int `json:"relativeAddress,omitempty"` OffsetFromParent *int `json:"offsetFromParent,omitempty"` Length *int `json:"length,omitempty"` Name *string `json:"name,omitempty"` FullyQualifiedName *string `json:"fullyQualifiedName,omitempty"` Kind *string `json:"kind,omitempty"` ParentIndex *uint `json:"parentIndex,omitempty"` }
Address ...
func (*Address) WithAbsoluteAddress ¶
WithAbsoluteAddress ...
func (*Address) WithFullyQualifiedName ¶
WithFullyQualifiedName ...
func (*Address) WithOffsetFromParent ¶
WithOffsetFromParent ...
func (*Address) WithParentIndex ¶
WithParentIndex ...
func (*Address) WithRelativeAddress ¶
WithRelativeAddress ...
type Artifact ¶
type Artifact struct { PropertyBag Location *ArtifactLocation `json:"location,omitempty"` ParentIndex *uint `json:"parentIndex,omitempty"` Offset *uint `json:"offset,omitempty"` Length int `json:"length"` Roles []string `json:"roles,omitempty"` MimeType *string `json:"mimeType,omitempty"` Contents *ArtifactContent `json:"contents,omitempty"` Encoding *string `json:"encoding,omitempty"` SourceLanguage *string `json:"sourceLanguage,omitempty"` Hashes map[string]string `json:"hashes,omitempty"` LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` Description *Message `json:"description,omitempty"` }
Artifact ...
func (*Artifact) WithContents ¶
func (a *Artifact) WithContents(artifactContent *ArtifactContent) *Artifact
WithContents ...
func (*Artifact) WithDescription ¶
WithDescription ...
func (*Artifact) WithEncoding ¶
WithEncoding ...
func (*Artifact) WithHashes ¶
WithHashes ...
func (*Artifact) WithLastModifiedTimeUtc ¶
WithLastModifiedTimeUtc ...
func (*Artifact) WithLocation ¶
func (a *Artifact) WithLocation(artifactLocation *ArtifactLocation) *Artifact
WithLocation ...
func (*Artifact) WithMimeType ¶
WithMimeType ...
func (*Artifact) WithParentIndex ¶
WithParentIndex ...
func (*Artifact) WithSourceLanguage ¶
WithSourceLanguage ...
type ArtifactChange ¶
type ArtifactChange struct { PropertyBag ArtifactLocation ArtifactLocation `json:"artifactLocation"` Replacements []*Replacement `json:"replacements"` //required }
ArtifactChange ...
func NewArtifactChange ¶
func NewArtifactChange(artifactLocation *ArtifactLocation) *ArtifactChange
NewArtifactChange ...
func (*ArtifactChange) WithReplacement ¶
func (a *ArtifactChange) WithReplacement(replacement *Replacement) *ArtifactChange
WithReplacement ...
type ArtifactContent ¶
type ArtifactContent struct { PropertyBag Text *string `json:"text,omitempty"` Binary *string `json:"binary,omitempty"` Rendered *MultiformatMessageString `json:"rendered,omitempty"` }
ArtifactContent ...
func (*ArtifactContent) WithBinary ¶
func (a *ArtifactContent) WithBinary(binary string) *ArtifactContent
WithBinary ...
func (*ArtifactContent) WithRendered ¶
func (a *ArtifactContent) WithRendered(mms *MultiformatMessageString) *ArtifactContent
WithRendered ...
func (*ArtifactContent) WithText ¶
func (a *ArtifactContent) WithText(text string) *ArtifactContent
WithText ...
type ArtifactLocation ¶
type ArtifactLocation struct { PropertyBag URI *string `json:"uri,omitempty"` URIBaseId *string `json:"uriBaseId,omitempty"` Index *uint `json:"index,omitempty"` Description *Message `json:"description,omitempty"` }
ArtifactLocation ...
func NewSimpleArtifactLocation ¶
func NewSimpleArtifactLocation(uri string) *ArtifactLocation
NewSimpleArtifactLocation ...
func (*ArtifactLocation) WithDescription ¶
func (a *ArtifactLocation) WithDescription(message *Message) *ArtifactLocation
WithDescription ...
func (*ArtifactLocation) WithIndex ¶
func (a *ArtifactLocation) WithIndex(index int) *ArtifactLocation
WithIndex ...
func (*ArtifactLocation) WithUri ¶
func (a *ArtifactLocation) WithUri(uri string) *ArtifactLocation
WithUri ...
func (*ArtifactLocation) WithUriBaseId ¶
func (a *ArtifactLocation) WithUriBaseId(uriBaseId string) *ArtifactLocation
WithUriBaseId ...
type Fix ¶
type Fix struct { PropertyBag Description *Message `json:"description,omitempty"` ArtifactChanges []*ArtifactChange `json:"artifactChanges"` // required }
Fix ...
func (*Fix) WithArtifactChange ¶
func (f *Fix) WithArtifactChange(ac *ArtifactChange) *Fix
WithArtifactChange ...
func (*Fix) WithDescription ¶
WithDescription ...
type Invocation ¶
type Invocation struct { PropertyBag StartTimeUTC *time.Time `json:"startTimeUtc,omitempty"` EndTimeUTC *time.Time `json:"endTimeUtc,omitempty"` ExecutionSuccessful bool `json:"executionSuccessful"` WorkingDirectory *ArtifactLocation `json:"workingDirectory,omitempty"` ToolExecutionNotifications []*Notification `json:"toolExecutionNotifications,omitempty"` }
Invocation describes the runtime environment of the analysis tool run.
func (*Invocation) WithEndTimeUTC ¶
func (i *Invocation) WithEndTimeUTC(endTime time.Time) *Invocation
WithEndTimeUTC sets the instant when the invocation ended and returns the same Invocation.
func (*Invocation) WithStartTimeUTC ¶
func (i *Invocation) WithStartTimeUTC(startTime time.Time) *Invocation
WithStartTimeUTC sets the instant when the invocation started and returns the same Invocation.
func (*Invocation) WithToolExecutionNotifications ¶ added in v1.1.1
func (i *Invocation) WithToolExecutionNotifications(notification *Notification) *Invocation
WithToolExecutionNotifications ...
func (*Invocation) WithWorkingDirectory ¶
func (i *Invocation) WithWorkingDirectory(workingDirectory *ArtifactLocation) *Invocation
WithWorkingDirectory sets the current working directory of the invocation and returns the same Invocation.
type Location ¶
type Location struct { PropertyBag Id *uint `json:"id,omitempty"` PhysicalLocation *PhysicalLocation `json:"physicalLocation,omitempty"` LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` Message *Message `json:"message,omitempty"` Annotations []*Region `json:"annotations,omitempty"` Relationships []*LocationRelationship `json:"relationships,omitempty"` }
Location ...
func NewLocationWithPhysicalLocation ¶
func NewLocationWithPhysicalLocation(physicalLocation *PhysicalLocation) *Location
NewLocationWithPhysicalLocation ...
func (*Location) WithAnnotation ¶
WithAnnotation ...
func (*Location) WithMessage ¶
WithMessage ...
func (*Location) WithPhysicalLocation ¶
func (l *Location) WithPhysicalLocation(physicalLocation *PhysicalLocation) *Location
WithPhysicalLocation ...
func (*Location) WithRelationship ¶
func (l *Location) WithRelationship(locationRelationship *LocationRelationship) *Location
WithRelationship ...
type LocationRelationship ¶
type LocationRelationship struct { PropertyBag Target uint `json:"target"` Kinds []string `json:"kinds,omitempty"` Description *Message `json:"description,omitempty"` }
LocationRelationship ...
func NewLocationRelationship ¶
func NewLocationRelationship(target int) *LocationRelationship
NewLocationRelationship ...
func (*LocationRelationship) WithDescription ¶
func (l *LocationRelationship) WithDescription(message *Message) *LocationRelationship
WithDescription ...
func (*LocationRelationship) WithKind ¶
func (l *LocationRelationship) WithKind(kind string) *LocationRelationship
WithKind ...
type LogicalLocation ¶
type LogicalLocation struct { PropertyBag Index *uint `json:"index,omitempty"` Name *string `json:"name,omitempty"` FullyQualifiedName *string `json:"fullyQualifiedName,omitempty"` DecoratedName *string `json:"decoratedName,omitempty"` Kind *string `json:"kind,omitempty"` ParentIndex *uint `json:"parentIndex,omitempty"` }
LogicalLocation ...
func (*LogicalLocation) WithDecoratedName ¶
func (l *LogicalLocation) WithDecoratedName(decoratedName string) *LogicalLocation
WithDecoratedName ...
func (*LogicalLocation) WithFullyQualifiedName ¶
func (l *LogicalLocation) WithFullyQualifiedName(fullyQualifiedName string) *LogicalLocation
WithFullyQualifiedName ...
func (*LogicalLocation) WithIndex ¶
func (l *LogicalLocation) WithIndex(index int) *LogicalLocation
WithIndex ...
func (*LogicalLocation) WithKind ¶
func (l *LogicalLocation) WithKind(kind string) *LogicalLocation
WithKind ...
func (*LogicalLocation) WithName ¶
func (l *LogicalLocation) WithName(name string) *LogicalLocation
WithName ...
func (*LogicalLocation) WithParentIndex ¶
func (l *LogicalLocation) WithParentIndex(parentIndex int) *LogicalLocation
WithParentIndex ...
type Message ¶
type Message struct { PropertyBag Text *string `json:"text,omitempty"` Markdown *string `json:"markdown,omitempty"` Id *string `json:"id,omitempty"` Arguments []string `json:"arguments,omitempty"` }
Message ...
func (*Message) WithArgument ¶
WithArgument ...
func (*Message) WithMarkdown ¶
WithMarkdown ...
type MultiformatMessageString ¶
type MultiformatMessageString struct { PropertyBag Text *string `json:"text,omitempty"` Markdown *string `json:"markdown,omitempty"` }
MultiformatMessageString ...
func NewMarkdownMultiformatMessageString ¶ added in v1.1.1
func NewMarkdownMultiformatMessageString(markdown string) *MultiformatMessageString
NewMarkdownMultiformatMessageString ...
func NewMultiformatMessageString ¶
func NewMultiformatMessageString(text string) *MultiformatMessageString
NewMultiformatMessageString ...
func (*MultiformatMessageString) WithMarkdown ¶
func (m *MultiformatMessageString) WithMarkdown(markdown string) *MultiformatMessageString
WithMarkdown ...
type Notification ¶ added in v1.1.1
type Notification struct { PropertyBag Level *string `json:"level,omitempty"` Message Message `json:"message"` Locations []*Location `json:"locations,omitempty"` Properties Properties `json:"properties,omitempty"` }
Notification represents different Notifications in the SARIF spec
func (*Notification) AttachPropertyBag ¶ added in v1.1.1
func (n *Notification) AttachPropertyBag(pb *PropertyBag)
AttachPropertyBag adds a property bag to a rule
func (*Notification) WithLevel ¶ added in v1.1.1
func (n *Notification) WithLevel(level string) *Notification
WithLevel ...
func (*Notification) WithLocation ¶ added in v1.1.1
func (n *Notification) WithLocation(location *Location) *Notification
WithLocation ...
func (*Notification) WithMessage ¶ added in v1.1.1
func (n *Notification) WithMessage(message *Message) *Notification
WithMessage ...
func (*Notification) WithProperties ¶ added in v1.1.1
func (n *Notification) WithProperties(properties Properties) *Notification
WithProperties specifies properties for a rule and returns the updated rule
type PhysicalLocation ¶
type PhysicalLocation struct { PropertyBag ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty"` Region *Region `json:"region,omitempty"` ContextRegion *Region `json:"contextRegion,omitempty"` Address *Address `json:"address,omitempty"` }
PhysicalLocation ...
func (*PhysicalLocation) WithAddress ¶
func (pl *PhysicalLocation) WithAddress(address *Address) *PhysicalLocation
WithAddress ...
func (*PhysicalLocation) WithArtifactLocation ¶
func (pl *PhysicalLocation) WithArtifactLocation(artifactLocation *ArtifactLocation) *PhysicalLocation
WithArtifactLocation ...
func (*PhysicalLocation) WithContextRegion ¶
func (pl *PhysicalLocation) WithContextRegion(contextRegion *Region) *PhysicalLocation
WithContextRegion ...
func (*PhysicalLocation) WithRegion ¶
func (pl *PhysicalLocation) WithRegion(region *Region) *PhysicalLocation
WithRegion ...
type PropertyBag ¶
type PropertyBag struct {
Properties Properties `json:"properties,omitempty"`
}
PropertyBag ...
func (*PropertyBag) AddBoolean ¶
func (pb *PropertyBag) AddBoolean(key string, value bool)
AddBoolean ...
func (*PropertyBag) AddInteger ¶
func (pb *PropertyBag) AddInteger(key string, value int)
AddInteger ...
type Region ¶
type Region struct { PropertyBag StartLine *int `json:"startLine,omitempty"` StartColumn *int `json:"startColumn,omitempty"` EndLine *int `json:"endLine,omitempty"` EndColumn *int `json:"endColumn,omitempty"` CharOffset *int `json:"charOffset,omitempty"` CharLength *int `json:"charLength,omitempty"` ByteOffset *int `json:"byteOffset,omitempty"` ByteLength *int `json:"byteLength,omitempty"` Snippet *ArtifactContent `json:"snippet,omitempty"` Message *Message `json:"message,omitempty"` SourceLanguage *string `json:"sourceLanguage,omitempty"` }
Region ...
func (*Region) WithByteLength ¶
WithByteLength ...
func (*Region) WithByteOffset ¶
WithByteOffset ...
func (*Region) WithCharLength ¶
WithCharLength ...
func (*Region) WithCharOffset ¶
WithCharOffset ...
func (*Region) WithEndColumn ¶
WithEndColumn ...
func (*Region) WithSnippet ¶
func (r *Region) WithSnippet(snippet *ArtifactContent) *Region
WithSnippet ...
func (*Region) WithSourceLanguage ¶
WithSourceLanguage ...
func (*Region) WithStartColumn ¶
WithStartColumn ...
func (*Region) WithStartLine ¶
WithStartLine ...
type Replacement ¶
type Replacement struct { PropertyBag DeletedRegion Region `json:"deletedRegion"` InsertedContent *ArtifactContent `json:"insertedContent,omitempty"` }
Replacement ...
func (*Replacement) WithInsertedContent ¶
func (r *Replacement) WithInsertedContent(artifactContent *ArtifactContent) *Replacement
WithInsertedContent ...
type Report ¶
type Report struct { PropertyBag Version string `json:"version"` Schema string `json:"$schema"` Runs []*Run `json:"runs"` }
Report is the encapsulating type representing a Sarif Report
func FromString ¶
FromString loads a Report from string content
func (*Report) PrettyWrite ¶
PrettyWrite writes the JSON output with indentation
type ReportingConfiguration ¶ added in v1.1.1
type ReportingConfiguration struct { Enabled bool `json:"enabled,omitempty"` Level interface{} `json:"level,omitempty"` Parameters *PropertyBag `json:"parameters,omitempty"` Properties *PropertyBag `json:"properties,omitempty"` Rank float64 `json:"rank,omitempty"` }
ReportingConfiguration ...
type ReportingDescriptor ¶ added in v1.1.1
type ReportingDescriptor struct { PropertyBag ID string `json:"id"` Name *string `json:"name,omitempty"` ShortDescription *MultiformatMessageString `json:"shortDescription"` FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` DefaultConfiguration *ReportingConfiguration `json:"defaultConfiguration,omitempty"` HelpURI *string `json:"helpUri,omitempty"` Help *MultiformatMessageString `json:"help,omitempty"` Properties Properties `json:"properties,omitempty"` }
ReportingDescriptor specifies a Sarif ReportingDescriptor object
func (*ReportingDescriptor) AttachPropertyBag ¶ added in v1.1.1
func (rule *ReportingDescriptor) AttachPropertyBag(pb *PropertyBag)
AttachPropertyBag adds a property bag to a rule
func (*ReportingDescriptor) WithDescription ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithDescription(description string) *ReportingDescriptor
WithDescription specifies short description for a rule and returns the updated rule. Short description should be a single sentence that is understandable when visible space is limited to a single line of text.
func (*ReportingDescriptor) WithFullDescription ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithFullDescription(description *MultiformatMessageString) *ReportingDescriptor
WithFullDescription specifies full description for a rule and returns the updated rule. Full description should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the result.
func (*ReportingDescriptor) WithHelp ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithHelp(helpText string) *ReportingDescriptor
WithHelp specifies a help text for a rule and returns the updated rule
func (*ReportingDescriptor) WithHelpURI ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithHelpURI(helpURI string) *ReportingDescriptor
WithHelpURI specifies a helpURI for a rule and returns the updated rule
func (*ReportingDescriptor) WithMarkdownHelp ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithMarkdownHelp(markdownText string) *ReportingDescriptor
WithMarkdownHelp specifies a help text for a rule and returns the updated rule
func (*ReportingDescriptor) WithName ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithName(name string) *ReportingDescriptor
WithName specifies rule name that is understandable to an end user and returns the updated rule.
func (*ReportingDescriptor) WithProperties ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithProperties(properties Properties) *ReportingDescriptor
WithProperties specifies properties for a rule and returns the updated rule
func (*ReportingDescriptor) WithShortDescription ¶ added in v1.1.1
func (rule *ReportingDescriptor) WithShortDescription(description *MultiformatMessageString) *ReportingDescriptor
WithShortDescription specifies short description for a rule and returns the updated rule. Short description should be a single sentence that is understandable when visible space is limited to a single line of text.
type ReportingDescriptorReference ¶
type ReportingDescriptorReference struct { PropertyBag Id *string `json:"id,omitempty"` Index *uint `json:"index,omitempty"` Guid *string `json:"guid,omitempty"` ToolComponent *ToolComponentReference `json:"toolComponent,omitempty"` }
ReportingDescriptorReference ...
func NewReportingDescriptorReference ¶
func NewReportingDescriptorReference() *ReportingDescriptorReference
NewReportingDescriptorReference ...
func (*ReportingDescriptorReference) WithGuid ¶
func (r *ReportingDescriptorReference) WithGuid(guid string) *ReportingDescriptorReference
WithGuid ...
func (*ReportingDescriptorReference) WithId ¶
func (r *ReportingDescriptorReference) WithId(id string) *ReportingDescriptorReference
WithId ...
func (*ReportingDescriptorReference) WithIndex ¶
func (r *ReportingDescriptorReference) WithIndex(index int) *ReportingDescriptorReference
WithIndex ...
func (*ReportingDescriptorReference) WithToolComponentReference ¶
func (r *ReportingDescriptorReference) WithToolComponentReference(toolComponentRef *ToolComponentReference) *ReportingDescriptorReference
WithToolComponentReference ...
type Result ¶
type Result struct { PropertyBag Guid *string `json:"guid,omitempty"` CorrelationGuid *string `json:"correlationGuid,omitempty"` RuleID *string `json:"ruleId,omitempty"` RuleIndex *uint `json:"ruleIndex,omitempty"` Rule *ReportingDescriptorReference `json:"rule,omitempty"` Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` Kind *string `json:"kind,omitempty"` Level *string `json:"level,omitempty"` Message Message `json:"message"` Locations []*Location `json:"locations,omitempty"` AnalysisTarget *ArtifactLocation `json:"analysisTarget,omitempty"` // WebRequest *webRequest `json:"webRequest,omitempty"` // WebResponse *webResponse `json:"webResponse,omitempty"` Fingerprints map[string]interface{} `json:"fingerprints,omitempty"` PartialFingerprints map[string]interface{} `json:"partialFingerprints,omitempty"` // CodeFlows []*codeFlows `json:"codeFlows,omitempty"` // Graphs []*graphs `json:"graphs,omitempty"` // GraphTraversals []*graphTraversals `json:"graphTraversals,omitempty"` // Stacks []*stack `json:"stacks,omitempty"` RelatedLocations []*Location `json:"relatedLocations,omitempty"` Suppressions []*Suppression `json:"suppressions,omitempty"` BaselineState *string `json:"baselineState,omitempty"` Rank *float32 `json:"rank,omitempty"` // Attachments []*attachment `json:"attachments,omitempty"` WorkItemUris []string `json:"workItemUris,omitempty"` // can be null HostedViewerUri *string `json:"hostedViewerUri,omitempty"` // Provenance *resultProvenance `json:"provenance,omitempty"` Fixes []*Fix `json:"fixes,omitempty"` OccurrenceCount *uint `json:"occurrenceCount,omitempty"` Properties Properties `json:"properties,omitempty"` }
Result represents the results block in the sarif report
func (*Result) AttachPropertyBag ¶
func (r *Result) AttachPropertyBag(pb *PropertyBag)
AttachPropertyBag adds a property bag to a rule
func (*Result) WithAnalysisTarget ¶
func (r *Result) WithAnalysisTarget(target *ArtifactLocation) *Result
WithAnalysisTarget ...
func (*Result) WithBaselineState ¶
WithBaselineState ...
func (*Result) WithCorrelationGuid ¶
WithCorrelationGuid ...
func (*Result) WithFingerPrints ¶
WithFingerPrints ...
func (*Result) WithHostedViewerUri ¶
WithHostedViewerUri ...
func (*Result) WithLocation ¶
WithLocation ...
func (*Result) WithOccurrenceCount ¶
WithOccurrenceCount ...
func (*Result) WithPartialFingerPrints ¶
WithPartialFingerPrints ...
func (*Result) WithProperties ¶
func (r *Result) WithProperties(properties Properties) *Result
WithProperties specifies properties for a rule and returns the updated rule
func (*Result) WithRelatedLocation ¶
WithRelatedLocation ...
func (*Result) WithRule ¶
func (r *Result) WithRule(rdp *ReportingDescriptorReference) *Result
WithRule ...
func (*Result) WithRuleIndex ¶
WithRuleIndex ...
func (*Result) WithSuppression ¶
func (r *Result) WithSuppression(suppression *Suppression) *Result
WithSuppression ...
func (*Result) WithTaxa ¶
func (r *Result) WithTaxa(rdp *ReportingDescriptorReference) *Result
WithTaxa ...
func (*Result) WithWorkItemUri ¶
WithWorkItemUri ...
type Run ¶
type Run struct { PropertyBag Tool Tool `json:"tool"` Invocations []*Invocation `json:"invocations,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` Results []*Result `json:"results"` Properties Properties `json:"properties,omitempty"` }
Run type represents a run of a tool
func (*Run) AddArtifact ¶
AddArtifact adds an artifact to the run and returns a pointer to it
func (*Run) AddDistinctArtifact ¶
AddDistinctArtifact will handle deduplication of simple artifact additions
func (*Run) AddInvocation ¶
func (run *Run) AddInvocation(executionSuccessful bool) *Invocation
AddInvocation adds an invocation to the run and returns a pointer to it
func (*Run) AddResult ¶
AddResult returns an existing Result or creates a new one and returns a pointer to it
func (*Run) AddRule ¶
func (run *Run) AddRule(ruleID string) *ReportingDescriptor
AddRule returns an existing ReportingDescriptor for the ruleID or creates a new ReportingDescriptor and returns a pointer to it
func (*Run) AttachPropertyBag ¶
func (run *Run) AttachPropertyBag(pb *PropertyBag)
AttachPropertyBag ...
func (*Run) GetResultByRuleId ¶
GetResultByRuleId finds the result for a ruleId and returns a pointer to it
func (*Run) GetRuleById ¶
func (run *Run) GetRuleById(ruleId string) (*ReportingDescriptor, error)
GetRuleById finds a rule by a given rule ID and returns a pointer to it
type Suppression ¶
type Suppression struct { PropertyBag Kind string `json:"kind,omitempty"` Status *string `json:"status,omitempty"` Location *Location `json:"location,omitempty"` Guid *string `json:"guid,omitempty"` Justification *string `json:"justification,omitempty"` }
Suppression ...
func (*Suppression) WithGuid ¶
func (s *Suppression) WithGuid(guid string) *Suppression
WithGuid ...
func (*Suppression) WithJustifcation ¶
func (s *Suppression) WithJustifcation(justification string) *Suppression
WithJustifcation ...
func (*Suppression) WithLocation ¶
func (s *Suppression) WithLocation(location *Location) *Suppression
WithLocation ...
func (*Suppression) WithStatus ¶
func (s *Suppression) WithStatus(status string) *Suppression
WithStatus ...
type ToolComponent ¶ added in v1.1.1
type ToolComponent struct { PropertyBag Name string `json:"name"` Version *string `json:"version,omitempty"` InformationURI *string `json:"informationUri"` Notifications []*ReportingDescriptor `json:"notifications,omitempty"` Rules []*ReportingDescriptor `json:"rules,omitempty"` Taxa []*ReportingDescriptor `json:"taxa,omitempty"` }
ToolComponent ...
func (*ToolComponent) WithVersion ¶ added in v1.1.1
func (driver *ToolComponent) WithVersion(version string) *ToolComponent
WithVersion specifies tool version, in whatever format it natively provides. Returns updated driver.
type ToolComponentReference ¶
type ToolComponentReference struct { PropertyBag Name *string `json:"name"` Index *uint `json:"index"` Guid *string `json:"guid"` }
ToolComponentReference ...
func NewToolComponentReference ¶
func NewToolComponentReference() *ToolComponentReference
NewToolComponentReference ...
func (*ToolComponentReference) WithGuid ¶
func (t *ToolComponentReference) WithGuid(guid string) *ToolComponentReference
WithGuid ...
func (*ToolComponentReference) WithIndex ¶
func (t *ToolComponentReference) WithIndex(index int) *ToolComponentReference
WithIndex ...
func (*ToolComponentReference) WithName ¶
func (t *ToolComponentReference) WithName(name string) *ToolComponentReference
WithName ...
Source Files ¶
- address.go
- artifact.go
- artifact_change.go
- artifact_content.go
- artifact_location.go
- fix.go
- invocation.go
- location.go
- location_relationship.go
- logical_location.go
- message.go
- multi_format_message_string.go
- notification.go
- physical_location.go
- properties.go
- region.go
- replacement.go
- reporting_descriptor.go
- reporting_descriptor_reference.go
- result.go
- run.go
- sarif.go
- suppression.go
- test_helpers.go
- tool.go
- tool_component.go
- tool_component_reference.go