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
- 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 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 ¶ added in v1.0.0
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"` }
func NewAddress ¶ added in v1.0.0
func NewAddress() *Address
func (*Address) WithAbsoluteAddress ¶ added in v1.0.0
func (*Address) WithFullyQualifiedName ¶ added in v1.0.0
func (*Address) WithLength ¶ added in v1.0.0
func (*Address) WithOffsetFromParent ¶ added in v1.0.0
func (*Address) WithParentIndex ¶ added in v1.0.0
func (*Address) WithRelativeAddress ¶ added in v1.0.0
type Artifact ¶ added in v1.0.0
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"` }
func NewArtifact ¶ added in v1.0.0
func NewArtifact() *Artifact
func (*Artifact) WithContents ¶ added in v1.0.0
func (a *Artifact) WithContents(artifactContent *ArtifactContent) *Artifact
func (*Artifact) WithDescription ¶ added in v1.0.0
func (*Artifact) WithEncoding ¶ added in v1.0.0
func (*Artifact) WithHashes ¶ added in v1.0.0
func (*Artifact) WithLastModifiedTimeUtc ¶ added in v1.0.0
func (*Artifact) WithLength ¶ added in v1.0.0
func (*Artifact) WithLocation ¶ added in v1.0.0
func (a *Artifact) WithLocation(artifactLocation *ArtifactLocation) *Artifact
func (*Artifact) WithMimeType ¶ added in v1.0.0
func (*Artifact) WithOffset ¶ added in v1.0.0
func (*Artifact) WithParentIndex ¶ added in v1.0.0
func (*Artifact) WithSourceLanguage ¶ added in v1.0.0
type ArtifactChange ¶ added in v1.0.0
type ArtifactChange struct { PropertyBag ArtifactLocation ArtifactLocation `json:"artifactLocation"` Replacements []*Replacement `json:"replacements"` //required }
func NewArtifactChange ¶ added in v1.0.0
func NewArtifactChange(artifactLocation *ArtifactLocation) *ArtifactChange
func (*ArtifactChange) WithReplacement ¶ added in v1.0.0
func (a *ArtifactChange) WithReplacement(replacement *Replacement) *ArtifactChange
type ArtifactContent ¶ added in v1.0.0
type ArtifactContent struct { PropertyBag Text *string `json:"text,omitempty"` Binary *string `json:"binary,omitempty"` Rendered *MultiformatMessageString `json:"rendered,omitempty"` }
func NewArtifactContent ¶ added in v1.0.0
func NewArtifactContent() *ArtifactContent
func (*ArtifactContent) WithBinary ¶ added in v1.0.0
func (a *ArtifactContent) WithBinary(binary string) *ArtifactContent
func (*ArtifactContent) WithRendered ¶ added in v1.0.0
func (a *ArtifactContent) WithRendered(mms *MultiformatMessageString) *ArtifactContent
func (*ArtifactContent) WithText ¶ added in v1.0.0
func (a *ArtifactContent) WithText(text string) *ArtifactContent
type ArtifactLocation ¶ added in v1.0.0
type ArtifactLocation struct { PropertyBag URI *string `json:"uri,omitempty"` URIBaseId *string `json:"uriBaseId,omitempty"` Index *uint `json:"index,omitempty"` Description *Message `json:"description,omitempty"` }
func NewArtifactLocation ¶ added in v1.0.0
func NewArtifactLocation() *ArtifactLocation
func NewSimpleArtifactLocation ¶ added in v1.0.0
func NewSimpleArtifactLocation(uri string) *ArtifactLocation
func (*ArtifactLocation) WithDescription ¶ added in v1.0.0
func (a *ArtifactLocation) WithDescription(message *Message) *ArtifactLocation
func (*ArtifactLocation) WithIndex ¶ added in v1.0.0
func (a *ArtifactLocation) WithIndex(index int) *ArtifactLocation
func (*ArtifactLocation) WithUri ¶ added in v1.0.0
func (a *ArtifactLocation) WithUri(uri string) *ArtifactLocation
func (*ArtifactLocation) WithUriBaseId ¶ added in v1.0.0
func (a *ArtifactLocation) WithUriBaseId(uriBaseId string) *ArtifactLocation
type Fix ¶ added in v1.0.0
type Fix struct { PropertyBag Description *Message `json:"description,omitempty"` ArtifactChanges []*ArtifactChange `json:"artifactChanges"` // required }
func (*Fix) WithArtifactChange ¶ added in v1.0.0
func (f *Fix) WithArtifactChange(ac *ArtifactChange) *Fix
func (*Fix) WithDescription ¶ added in v1.0.0
type Invocation ¶ added in v1.0.1
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"` }
Invocation describes the runtime environment of the analysis tool run.
func (*Invocation) WithEndTimeUTC ¶ added in v1.0.1
func (i *Invocation) WithEndTimeUTC(endTime time.Time) *Invocation
WithEndTimeUTC sets the instant when the invocation ended and returns the same Invocation.
func (*Invocation) WithStartTimeUTC ¶ added in v1.0.1
func (i *Invocation) WithStartTimeUTC(startTime time.Time) *Invocation
WithStartTimeUTC sets the instant when the invocation started and returns the same Invocation.
func (*Invocation) WithWorkingDirectory ¶ added in v1.0.1
func (i *Invocation) WithWorkingDirectory(workingDirectory *ArtifactLocation) *Invocation
WithWorkingDirectory sets the current working directory of the invocation and returns the same Invocation.
type Location ¶ added in v1.0.0
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"` }
func NewLocation ¶ added in v1.0.0
func NewLocation() *Location
func NewLocationWithPhysicalLocation ¶ added in v1.0.2
func NewLocationWithPhysicalLocation(physicalLocation *PhysicalLocation) *Location
func (*Location) WithAnnotation ¶ added in v1.0.0
func (*Location) WithMessage ¶ added in v1.0.0
func (*Location) WithPhysicalLocation ¶ added in v1.0.0
func (l *Location) WithPhysicalLocation(physicalLocation *PhysicalLocation) *Location
func (*Location) WithRelationship ¶ added in v1.0.0
func (l *Location) WithRelationship(locationRelationship *LocationRelationship) *Location
type LocationRelationship ¶ added in v1.0.0
type LocationRelationship struct { PropertyBag Target uint `json:"target"` Kinds []string `json:"kinds,omitempty"` Description *Message `json:"description,omitempty"` }
func NewLocationRelationship ¶ added in v1.0.0
func NewLocationRelationship(target int) *LocationRelationship
func (*LocationRelationship) WithDescription ¶ added in v1.0.0
func (l *LocationRelationship) WithDescription(message *Message) *LocationRelationship
func (*LocationRelationship) WithKind ¶ added in v1.0.0
func (l *LocationRelationship) WithKind(kind string) *LocationRelationship
type LogicalLocation ¶ added in v1.0.0
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"` }
func NewLogicalLocation ¶ added in v1.0.0
func NewLogicalLocation() *LogicalLocation
func (*LogicalLocation) WithDecoratedName ¶ added in v1.0.0
func (l *LogicalLocation) WithDecoratedName(decoratedName string) *LogicalLocation
func (*LogicalLocation) WithFullyQualifiedName ¶ added in v1.0.0
func (l *LogicalLocation) WithFullyQualifiedName(fullyQualifiedName string) *LogicalLocation
func (*LogicalLocation) WithIndex ¶ added in v1.0.0
func (l *LogicalLocation) WithIndex(index int) *LogicalLocation
func (*LogicalLocation) WithKind ¶ added in v1.0.0
func (l *LogicalLocation) WithKind(kind string) *LogicalLocation
func (*LogicalLocation) WithName ¶ added in v1.0.0
func (l *LogicalLocation) WithName(name string) *LogicalLocation
func (*LogicalLocation) WithParentIndex ¶ added in v1.0.0
func (l *LogicalLocation) WithParentIndex(parentIndex int) *LogicalLocation
type Message ¶ added in v1.0.0
type Message struct { PropertyBag Text *string `json:"text,omitempty"` Markdown *string `json:"markdown,omitempty"` Id *string `json:"id,omitempty"` Arguments []string `json:"arguments,omitempty"` }
func NewMarkdownMessage ¶ added in v1.0.0
func NewMessage ¶ added in v1.0.0
func NewMessage() *Message
func NewTextMessage ¶ added in v1.0.0
func (*Message) WithArgument ¶ added in v1.0.0
func (*Message) WithMarkdown ¶ added in v1.0.0
type MultiformatMessageString ¶ added in v1.0.0
type MultiformatMessageString struct { PropertyBag Text *string `json:"text,omitempty"` Markdown *string `json:"markdown,omitempty"` }
func NewMarkdownMultiformatMessageString ¶ added in v1.1.0
func NewMarkdownMultiformatMessageString(markdown string) *MultiformatMessageString
func NewMultiformatMessageString ¶ added in v1.0.0
func NewMultiformatMessageString(text string) *MultiformatMessageString
func (*MultiformatMessageString) WithMarkdown ¶ added in v1.0.0
func (m *MultiformatMessageString) WithMarkdown(markdown string) *MultiformatMessageString
type PhysicalLocation ¶ added in v1.0.0
type PhysicalLocation struct { PropertyBag ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty"` Region *Region `json:"region,omitempty"` ContextRegion *Region `json:"contextRegion,omitempty"` Address *Address `json:"address,omitempty"` }
func NewPhysicalLocation ¶ added in v1.0.0
func NewPhysicalLocation() *PhysicalLocation
func (*PhysicalLocation) WithAddress ¶ added in v1.0.0
func (pl *PhysicalLocation) WithAddress(address *Address) *PhysicalLocation
func (*PhysicalLocation) WithArtifactLocation ¶ added in v1.0.0
func (pl *PhysicalLocation) WithArtifactLocation(artifactLocation *ArtifactLocation) *PhysicalLocation
func (*PhysicalLocation) WithContextRegion ¶ added in v1.0.0
func (pl *PhysicalLocation) WithContextRegion(contextRegion *Region) *PhysicalLocation
func (*PhysicalLocation) WithRegion ¶ added in v1.0.0
func (pl *PhysicalLocation) WithRegion(region *Region) *PhysicalLocation
type Properties ¶ added in v1.0.2
type Properties map[string]interface{}
type PropertyBag ¶ added in v1.0.2
type PropertyBag struct {
Properties Properties `json:"properties,omitempty"`
}
func NewPropertyBag ¶ added in v1.0.2
func NewPropertyBag() *PropertyBag
func (*PropertyBag) Add ¶ added in v1.0.2
func (pb *PropertyBag) Add(key string, value interface{})
func (*PropertyBag) AddBoolean ¶ added in v1.0.2
func (pb *PropertyBag) AddBoolean(key string, value bool)
func (*PropertyBag) AddInteger ¶ added in v1.0.2
func (pb *PropertyBag) AddInteger(key string, value int)
func (*PropertyBag) AddString ¶ added in v1.0.2
func (pb *PropertyBag) AddString(key, value string)
type Region ¶ added in v1.0.0
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"` }
func NewSimpleRegion ¶ added in v1.0.0
func (*Region) WithByteLength ¶ added in v1.0.0
func (*Region) WithByteOffset ¶ added in v1.0.0
func (*Region) WithCharLength ¶ added in v1.0.0
func (*Region) WithCharOffset ¶ added in v1.0.0
func (*Region) WithEndColumn ¶ added in v1.0.0
func (*Region) WithEndLine ¶ added in v1.0.0
func (*Region) WithMessage ¶ added in v1.0.0
func (*Region) WithSnippet ¶ added in v1.0.0
func (r *Region) WithSnippet(snippet *ArtifactContent) *Region
func (*Region) WithSourceLanguage ¶ added in v1.0.0
func (*Region) WithStartColumn ¶ added in v1.0.0
func (*Region) WithStartLine ¶ added in v1.0.0
type Replacement ¶ added in v1.0.0
type Replacement struct { PropertyBag DeletedRegion Region `json:"deletedRegion"` InsertedContent *ArtifactContent `json:"insertedContent,omitempty"` }
func NewReplacement ¶ added in v1.0.0
func NewReplacement(region *Region) *Replacement
func (*Replacement) WithInsertedContent ¶ added in v1.0.0
func (r *Replacement) WithInsertedContent(artifactContent *ArtifactContent) *Replacement
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 ¶ added in v0.0.6
FromString loads a Report from string content
func (*Report) PrettyWrite ¶
PrettyWrite writes the JSON output with indentation
type ReportingConfiguration ¶ added in v1.1.0
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"` }
type ReportingDescriptor ¶ added in v1.1.0
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.0
func (rule *ReportingDescriptor) AttachPropertyBag(pb *PropertyBag)
AttachPropertyBag adds a property bag to a rule
func (*ReportingDescriptor) WithDescription ¶ added in v1.1.0
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.0
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.0
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.0
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.0
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.0
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.0
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.0
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 ¶ added in v1.0.0
type ReportingDescriptorReference struct { PropertyBag Id *string `json:"id,omitempty"` Index *uint `json:"index,omitempty"` Guid *string `json:"guid,omitempty"` ToolComponent *ToolComponentReference `json:"toolComponent,omitempty"` }
func NewReportingDescriptorReference ¶ added in v1.0.0
func NewReportingDescriptorReference() *ReportingDescriptorReference
func (*ReportingDescriptorReference) WithGuid ¶ added in v1.0.0
func (r *ReportingDescriptorReference) WithGuid(guid string) *ReportingDescriptorReference
func (*ReportingDescriptorReference) WithId ¶ added in v1.0.0
func (r *ReportingDescriptorReference) WithId(id string) *ReportingDescriptorReference
func (*ReportingDescriptorReference) WithIndex ¶ added in v1.0.0
func (r *ReportingDescriptorReference) WithIndex(index int) *ReportingDescriptorReference
func (*ReportingDescriptorReference) WithToolComponentReference ¶ added in v1.0.0
func (r *ReportingDescriptorReference) WithToolComponentReference(toolComponentRef *ToolComponentReference) *ReportingDescriptorReference
type Result ¶ added in v1.0.0
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 ¶ added in v1.0.9
func (r *Result) AttachPropertyBag(pb *PropertyBag)
AttachPropertyBag adds a property bag to a rule
func (*Result) WithAnalysisTarget ¶ added in v1.0.0
func (r *Result) WithAnalysisTarget(target *ArtifactLocation) *Result
func (*Result) WithBaselineState ¶ added in v1.0.0
func (*Result) WithCorrelationGuid ¶ added in v1.0.0
func (*Result) WithFingerPrints ¶ added in v1.0.0
func (*Result) WithHostedViewerUri ¶ added in v1.0.0
func (*Result) WithLocation ¶ added in v1.0.0
func (*Result) WithMessage ¶ added in v1.0.0
func (*Result) WithOccurrenceCount ¶ added in v1.0.0
func (*Result) WithPartialFingerPrints ¶ added in v1.0.0
func (*Result) WithProperties ¶ added in v1.0.9
func (r *Result) WithProperties(properties Properties) *Result
WithProperties specifies properties for a rule and returns the updated rule
func (*Result) WithRelatedLocation ¶ added in v1.0.0
func (*Result) WithRule ¶ added in v1.0.0
func (r *Result) WithRule(rdp *ReportingDescriptorReference) *Result
func (*Result) WithRuleIndex ¶ added in v1.0.0
func (*Result) WithSuppression ¶ added in v1.0.0
func (r *Result) WithSuppression(suppression *Suppression) *Result
func (*Result) WithTaxa ¶ added in v1.0.0
func (r *Result) WithTaxa(rdp *ReportingDescriptorReference) *Result
func (*Result) WithWorkItemUri ¶ added in v1.0.0
type Run ¶ added in v1.0.0
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 ¶ added in v1.0.0
AddArtifact adds an artifact to the run and returns a pointer to it
func (*Run) AddDistinctArtifact ¶ added in v1.0.8
AddDistinctArtifact will handle deduplication of simple artifact additions
func (*Run) AddInvocation ¶ added in v1.0.1
func (run *Run) AddInvocation(executionSuccessful bool) *Invocation
AddInvocation adds an invocation to the run and returns a pointer to it
func (*Run) AddResult ¶ added in v1.0.0
AddResult returns an existing Result or creates a new one and returns a pointer to it
func (*Run) AddRule ¶ added in v1.0.0
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 ¶ added in v1.0.2
func (run *Run) AttachPropertyBag(pb *PropertyBag)
func (*Run) DedupeArtifacts ¶ added in v1.0.0
func (*Run) GetResultByRuleId ¶ added in v1.0.0
GetResultByRuleId finds the result for a ruleId and returns a pointer to it
func (*Run) GetRuleById ¶ added in v1.0.0
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 ¶ added in v1.0.0
type Suppression struct { PropertyBag Kind string `json:"kind"` Status *string `json:"status"` Location *Location `json:"location"` Guid *string `json:"guid"` Justification *string `json:"justification"` }
func NewSuppression ¶ added in v1.0.0
func NewSuppression(kind string) *Suppression
func (*Suppression) WithGuid ¶ added in v1.0.0
func (s *Suppression) WithGuid(guid string) *Suppression
func (*Suppression) WithJustifcation ¶ added in v1.0.0
func (s *Suppression) WithJustifcation(justification string) *Suppression
func (*Suppression) WithLocation ¶ added in v1.0.0
func (s *Suppression) WithLocation(location *Location) *Suppression
func (*Suppression) WithStatus ¶ added in v1.0.0
func (s *Suppression) WithStatus(status string) *Suppression
type Tool ¶ added in v1.0.0
type Tool struct { PropertyBag Driver *ToolComponent `json:"driver"` }
type ToolComponent ¶ added in v1.1.0
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"` }
func (*ToolComponent) WithVersion ¶ added in v1.1.0
func (driver *ToolComponent) WithVersion(version string) *ToolComponent
WithVersion specifies tool version, in whatever format it natively provides. Returns updated driver.
type ToolComponentReference ¶ added in v1.0.0
type ToolComponentReference struct { PropertyBag Name *string `json:"name"` Index *uint `json:"index"` Guid *string `json:"guid"` }
func NewToolComponentReference ¶ added in v1.0.0
func NewToolComponentReference() *ToolComponentReference
func (*ToolComponentReference) WithGuid ¶ added in v1.0.0
func (t *ToolComponentReference) WithGuid(guid string) *ToolComponentReference
func (*ToolComponentReference) WithIndex ¶ added in v1.0.0
func (t *ToolComponentReference) WithIndex(index int) *ToolComponentReference
func (*ToolComponentReference) WithName ¶ added in v1.0.0
func (t *ToolComponentReference) WithName(name string) *ToolComponentReference
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
- 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