external

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapPackageDTOToReport added in v0.0.10

func MapPackageDTOToReport(dto *PackageDTO, sbom []byte) *model.Report

MapPackageDTOToReport maps the PackageDTO to a Report.

Types

type PackageDTO added in v0.0.8

type PackageDTO struct {
	CreatedAt  time.Time
	UpdatedAt  time.Time
	Name       string
	Repository string
	Tag        string
	Scans      []ScanDTO
	Config     types.ZarfPackage
	ID         uint
}

PackageDTO is a struct that represents the package data transfer object.

func MapPackageToDTO added in v0.0.8

func MapPackageToDTO(pkg *model.Package) PackageDTO

MapPackageToDTO maps the Package to a PackageDTO.

type ScanDTO

type ScanDTO struct {
	CreatedAt       time.Time             `json:"CreatedAt"`
	ArtifactName    string                `json:"ArtifactName"`
	ArtifactType    string                `json:"ArtifactType"`
	Metadata        json.RawMessage       `json:"Metadata"`
	Vulnerabilities []model.Vulnerability `json:"Vulnerabilities"`
	ID              uint                  `json:"ID"`
	SchemaVersion   int                   `json:"SchemaVersion"`
	PackageID       uint                  `json:"PackageID"`
}

ScanDTO is a struct that represents the scan data transfer object.

func MapScanResultToDTO

func MapScanResultToDTO(result *ScanResult) ScanDTO

MapScanResultToDTO maps the ScanResult to a slice of ScanDTO.

type ScanResult

type ScanResult struct {
	Metadata     model.Metadata `json:"Metadata"`
	CreatedAt    time.Time      `json:"CreatedAt"`
	ArtifactName string         `json:"ArtifactName"`
	ArtifactType string         `json:"ArtifactType"`
	Results      []struct {
		Target          string                `json:"Target"`
		Class           string                `json:"Class"`
		Type            string                `json:"Type"`
		Vulnerabilities []model.Vulnerability `json:"Vulnerabilities"`
	} `json:"Results"`
	SchemaVersion int  `json:"SchemaVersion"`
	ID            uint `json:"ID"`
}

ScanResult is a struct that represents the scan result.

Jump to

Keyboard shortcuts

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