generator

package
v0.1.116 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL