Documentation
¶
Overview ¶
Package model defines evidence-bearing values shared by Radar subsystems.
Index ¶
- Constants
- func ContractID(schema, pointer string) string
- func EntityID(kind, path, qualified string, occurrence int) string
- func FileID(path string) string
- func ModuleID(language, module string) string
- func PathFromID(id string) string
- func SchemaFieldID(schema, pointer string) string
- func SortSnapshot(s *Snapshot)
- func StableID(parts ...string) string
- type Diagnostic
- type Edge
- type Evidence
- type Finding
- type Node
- type Provenance
- type Severity
- type Snapshot
- type Status
Constants ¶
View Source
const RepositoryID = "repository"
RepositoryID identifies the repository root node.
Variables ¶
This section is empty.
Functions ¶
func ContractID ¶
ContractID identifies an explicitly bound schema object.
func EntityID ¶
EntityID identifies a declaration by kind, file and qualified scope. Repeated declarations of the same name receive an occurrence suffix (~1, ~2, ...).
func PathFromID ¶
PathFromID returns the repository path encoded in a file, declaration or schema identity, or "" when the identity does not name a file.
func SchemaFieldID ¶
SchemaFieldID identifies a property of an explicitly bound schema object.
func SortSnapshot ¶
func SortSnapshot(s *Snapshot)
SortSnapshot orders nodes and edges by identity for deterministic output.
Types ¶
type Diagnostic ¶
type Edge ¶
type Edge struct {
ID string `json:"id"`
From string `json:"from"`
To string `json:"to"`
Kind string `json:"kind"`
Provenance Provenance `json:"provenance"`
}
type Finding ¶
type Finding struct {
ID string `json:"id"`
Severity Severity `json:"severity"`
Evidence Evidence `json:"evidence"`
Code string `json:"code"`
Explanation string `json:"explanation"`
Contract string `json:"contract,omitempty"`
Producer string `json:"producer,omitempty"`
Consumer string `json:"consumer,omitempty"`
Branches []string `json:"branches,omitempty"`
Locations []Provenance `json:"locations,omitempty"`
Remediation string `json:"remediation,omitempty"`
Verification string `json:"verification,omitempty"`
}
func NewFinding ¶
type Provenance ¶
type Provenance struct {
Repository string `json:"repository"`
Revision string `json:"revision"`
Path string `json:"path,omitempty"`
Line int `json:"line,omitempty"`
EndLine int `json:"end_line,omitempty"`
Method string `json:"method"`
Evidence Evidence `json:"evidence"`
Timestamp string `json:"timestamp,omitempty"`
}
type Snapshot ¶
type Snapshot struct {
Repository string `json:"repository"`
Revision string `json:"revision"`
Nodes []Node `json:"nodes"`
Edges []Edge `json:"edges"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
Click to show internal directories.
Click to hide internal directories.