Documentation
¶
Overview ¶
Package producers provides helper functions for writing Dracon compatible producers that parse tool outputs. Subdirectories in this package have more complete example usages of this package.
Index ¶
Examples ¶
Constants ¶
View Source
const ( // EnvDraconStartTime Start Time of Dracon Scan in RFC3339 EnvDraconStartTime = "DRACON_SCAN_TIME" // EnvDraconScanID the ID of the dracon scan EnvDraconScanID = "DRACON_SCAN_ID" )
Variables ¶
View Source
var ( InResults string OutFile string )
Functions ¶
func ParseFlags ¶
func ParseFlags() error
ParseFlags will parse the input flags for the producer and perform simple validation
Example ¶
if err := ParseFlags(); err != nil {
log.Fatal(err)
}
func ParseInFileJSON ¶
func ParseInFileJSON(structure interface{}) error
ParseInFileJSON provides a generic method to parse a tool's JSON results into a given struct
Example ¶
type GoSecOut struct {
Issues []struct {
Severity string `json:"severity"`
Confidence string `json:"confidence"`
RuleID string `json:"rule_id"`
Details string `json:"details"`
File string `json:"file"`
Code string `json:"code"`
Line string `json:"line"`
Column string `json:"column"`
} `json:"Issues"`
}
var results GoSecOut
if err := ParseInFileJSON(&results); err != nil {
log.Fatal(err)
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.