Documentation
¶
Overview ¶
Package generator defines the CloudEvents event type and payload for on-demand vulnerability report generation requests.
Index ¶
Examples ¶
Constants ¶
View Source
const GenerateVulnReportEventType = "dev.chainguard.vulnreport.generate.v1"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GenerateVulnReportEvent ¶
type GenerateVulnReportEvent struct {
// RepoID identifies the UIDP of the repository used to generate the report
RepoID string `json:"repo_id"`
// Digest holds the digest being used to generate the report.
// Digest will hold the sha256 content.
Digest string `json:"digest"`
// Type determines whether the report being generated is a refresh.
Type string `json:"type"`
// When holds when the generation of the report occurred.
When civil.DateTime `json:"when"`
// Status to represent the problem
Status *status.Status `json:"status,omitempty"`
}
GenerateVulnReportEvent is an event used to trigger the generation of scan reports on-demand
Example ¶
ExampleGenerateVulnReportEvent demonstrates constructing a GenerateVulnReportEvent.
package main
import (
"fmt"
"chainguard.dev/sdk/events/generator"
)
func main() {
evt := generator.GenerateVulnReportEvent{
RepoID: "abc123",
Digest: "sha256:deadbeef",
Type: "refresh",
}
fmt.Println(evt.RepoID)
fmt.Println(evt.Type)
}
Output: abc123 refresh
Click to show internal directories.
Click to hide internal directories.