utils

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateHTMLToPDF

func GenerateHTMLToPDF(data ScanReportData) string

GenerateHTMLToPDF generates HTML content that can be converted to PDF

func GenerateSimplePDF

func GenerateSimplePDF(data ScanReportData) ([]byte, error)

GenerateSimplePDF generates a simple text-based PDF content Note: This is a basic implementation. For production use, consider using a proper PDF library

Types

type ScanReportData

type ScanReportData struct {
	ScanID      string                 `json:"scan_id"`
	Repository  string                 `json:"repository"`
	Platform    string                 `json:"platform"`
	Status      string                 `json:"status"`
	StartedAt   time.Time              `json:"started_at"`
	CompletedAt time.Time              `json:"completed_at"`
	Duration    string                 `json:"duration"`
	Threats     []ThreatInfo           `json:"threats"`
	Summary     ScanSummary            `json:"summary"`
	Metadata    map[string]interface{} `json:"metadata"`
}

ScanReportData represents the data structure for PDF reports

type ScanSummary

type ScanSummary struct {
	TotalPackages      int `json:"total_packages"`
	VulnerablePackages int `json:"vulnerable_packages"`
	CriticalThreats    int `json:"critical_threats"`
	HighThreats        int `json:"high_threats"`
	MediumThreats      int `json:"medium_threats"`
	LowThreats         int `json:"low_threats"`
}

ScanSummary represents scan summary statistics

type ThreatInfo

type ThreatInfo struct {
	Type        string `json:"type"`
	Severity    string `json:"severity"`
	Package     string `json:"package"`
	Description string `json:"description"`
	Remediation string `json:"remediation"`
}

ThreatInfo represents threat information

Jump to

Keyboard shortcuts

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