db

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReport added in v0.0.10

func GetReport(db *gorm.DB, id uint) (*model.Report, error)

GetReport retrieves a report by its ID from the database.

func InsertReport added in v0.0.10

func InsertReport(db *gorm.DB, report *model.Report) error

InsertReport inserts a new report into the database.

Types

type GormScanManager

type GormScanManager struct {
	// contains filtered or unexported fields
}

GormScanManager implements the ScanManager interface using a GORM DB connection.

func NewGormScanManager

func NewGormScanManager(db *gorm.DB) (*GormScanManager, error)

NewGormScanManager creates a new GormScanManager.

func (*GormScanManager) GetScan

func (manager *GormScanManager) GetScan(ctx context.Context, id uint) (*model.Scan, error)

GetScan retrieves a Scan and its associated Vulnerabilities from the database.

func (*GormScanManager) InsertPackageScans added in v0.0.8

func (manager *GormScanManager) InsertPackageScans(ctx context.Context, dto *external.PackageDTO) error

InsertPackageScans inserts a new Package and its associated Scans into the database.

func (*GormScanManager) InsertReport added in v0.0.10

func (manager *GormScanManager) InsertReport(ctx context.Context, report *model.Report) error

InsertReport inserts a new report into the database.

func (*GormScanManager) InsertScan

func (manager *GormScanManager) InsertScan(ctx context.Context, dto *external.ScanDTO) error

InsertScan inserts a new Scan and its associated Vulnerabilities into the database.

func (*GormScanManager) UpdateScan

func (manager *GormScanManager) UpdateScan(ctx context.Context, dto *external.ScanDTO) error

UpdateScan updates an existing Scan and its associated Vulnerabilities in the database.

type PackageManager added in v0.0.8

type PackageManager interface {
	InsertPackage(ctx context.Context, dto *external.PackageDTO) error
}

type ScanManager

type ScanManager interface {
	// InsertScan inserts a new Scan and its associated Vulnerabilities into the database.
	InsertScan(ctx context.Context, dto *external.ScanDTO) error
	// UpdateScan updates an existing Scan and its associated Vulnerabilities in the database.
	UpdateScan(ctx context.Context, dto *external.ScanDTO) error
	// GetScan retrieves a Scan and its associated Vulnerabilities from the database.
	GetScan(ctx context.Context, id uint) (*model.Scan, error)
}

ScanManager defines the interface for managing scans in the database.

Jump to

Keyboard shortcuts

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