Documentation
¶
Index ¶
- Variables
- func DefaultPath(format Format) (string, error)
- func Encode(format Format, req Request) ([]byte, error)
- func EncodeCSV(casesList []cases.Case) ([]byte, error)
- func EncodeJSONL(casesList []cases.Case, telemetry Telemetry) ([]byte, error)
- func EncodeSARIF(casesList []cases.Case) ([]byte, error)
- func MustRegisterFormat(spec FormatSpec)
- func RegisterFormat(spec FormatSpec) error
- type CaseMetrics
- type EncodeFunc
- type Format
- type FormatSpec
- type Request
- type Telemetry
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultSARIFPath is where the SARIF export is written when no --out flag is provided. DefaultSARIFPath = filepath.Join(defaultOutputDir, sarifFilename) // DefaultJSONLPath is where the JSONL export is written when no --out flag is provided. DefaultJSONLPath = filepath.Join(defaultOutputDir, jsonlFilename) // DefaultCSVPath is where the CSV export is written when no --out flag is provided. DefaultCSVPath = filepath.Join(defaultOutputDir, csvFilename) )
Functions ¶
func DefaultPath ¶
DefaultPath returns the default output location for the provided format if defined.
func Encode ¶
Encode resolves the requested format and renders the dataset using the registered implementation.
func EncodeJSONL ¶
EncodeJSONL renders the telemetry snapshot followed by individual case entries as JSONL.
func EncodeSARIF ¶
EncodeSARIF converts cases into a SARIF 2.1.0 log for interoperability with security tooling.
func MustRegisterFormat ¶
func MustRegisterFormat(spec FormatSpec)
MustRegisterFormat adds an exporter to the registry and panics if registration fails.
func RegisterFormat ¶
func RegisterFormat(spec FormatSpec) error
RegisterFormat adds a new exporter implementation to the registry.
Types ¶
type CaseMetrics ¶
type CaseMetrics struct {
SourceCount int `json:"source_count"`
EvidenceCount int `json:"evidence_count"`
}
CaseMetrics captures per-case aggregates emitted alongside case entries.
type EncodeFunc ¶
EncodeFunc renders the provided dataset into an exportable representation.
type Format ¶
type Format string
Format identifies the supported export encodings.
func ParseFormat ¶
ParseFormat validates the provided format string.
type FormatSpec ¶
type FormatSpec struct {
Format Format
Description string
DefaultFilename string
Encode EncodeFunc
}
FormatSpec describes an exporter implementation registered at runtime.
func Formats ¶
func Formats() []FormatSpec
Formats returns the registered exporters sorted by format name.
type Telemetry ¶
type Telemetry struct {
GeneratedAt findings.Timestamp `json:"generated_at"`
CaseCount int `json:"case_count"`
FindingCount int `json:"finding_count"`
SeverityCounts map[string]int `json:"severity_counts"`
PluginCounts map[string]int `json:"plugin_counts"`
}
Telemetry summarises a pipeline export for downstream data lakes.