Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Converter ¶
type Converter interface {
// Convert reads scanner output and produces a SARIF report.
Convert(r io.Reader) (*sarif.SarifReport, error)
}
Converter converts scanner output in a specific format to a SARIF report.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry maps format names to converters.
func NewDefaultRegistry ¶
func NewDefaultRegistry() *Registry
NewDefaultRegistry creates a registry pre-loaded with all built-in converters.
type SarifConverter ¶
type SarifConverter struct{}
SarifConverter implements Converter for native SARIF 2.1.0 output. This is a passthrough that delegates to the existing sarif.Parse().
func (*SarifConverter) Convert ¶
func (s *SarifConverter) Convert(r io.Reader) (*sarif.SarifReport, error)
type SemgrepConverter ¶
type SemgrepConverter struct{}
SemgrepConverter implements Converter for Semgrep's native JSON format.
func (*SemgrepConverter) Convert ¶
func (s *SemgrepConverter) Convert(r io.Reader) (*sarif.SarifReport, error)
type SemgrepError ¶
SemgrepError represents an error entry in Semgrep output.
type SemgrepExtra ¶
type SemgrepExtra struct {
Message string `json:"message"`
Severity string `json:"severity"`
Metadata SemgrepMetadata `json:"metadata"`
Lines string `json:"lines"`
}
SemgrepExtra contains additional finding metadata.
type SemgrepMetadata ¶
type SemgrepMetadata struct {
CWE interface{} `json:"cwe"` // string or []string
Confidence string `json:"confidence"`
Category string `json:"category"`
}
SemgrepMetadata contains rule metadata from Semgrep.
type SemgrepOutput ¶
type SemgrepOutput struct {
Results []SemgrepResult `json:"results"`
Errors []SemgrepError `json:"errors"`
Version string `json:"version"`
}
SemgrepOutput represents the top-level structure of Semgrep's native JSON output.
type SemgrepPos ¶
SemgrepPos represents a position in a file.
type SemgrepResult ¶
type SemgrepResult struct {
CheckID string `json:"check_id"`
Path string `json:"path"`
Start SemgrepPos `json:"start"`
End SemgrepPos `json:"end"`
Extra SemgrepExtra `json:"extra"`
}
SemgrepResult represents a single finding in Semgrep's native JSON.