model

package
v0.86.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	VulnerabilityTableName    = "vulnerability"
	GetVulnerabilityIndexName = "get_vulnerability_index"
)
View Source
const (
	IDTableName = "id"
)
View Source
const (
	VulnerabilityMetadataTableName = "vulnerability_metadata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type IDModel

type IDModel struct {
	BuildTimestamp string `gorm:"column:build_timestamp"`
	SchemaVersion  int    `gorm:"column:schema_version"`
}

func NewIDModel

func NewIDModel(id v3.ID) IDModel

func (*IDModel) Inflate

func (m *IDModel) Inflate() (v3.ID, error)

func (IDModel) TableName

func (IDModel) TableName() string

type VulnerabilityMetadataModel

type VulnerabilityMetadataModel struct {
	ID           string `gorm:"primary_key; column:id;"`
	Namespace    string `gorm:"primary_key; column:namespace;"`
	DataSource   string `gorm:"column:data_source"`
	RecordSource string `gorm:"column:record_source"`
	Severity     string `gorm:"column:severity"`
	URLs         string `gorm:"column:urls"`
	Description  string `gorm:"column:description"`
	Cvss         string `gorm:"column:cvss"`
}

VulnerabilityMetadataModel is a struct used to serialize db.VulnerabilityMetadata information into a sqlite3 DB.

func NewVulnerabilityMetadataModel

func NewVulnerabilityMetadataModel(metadata v3.VulnerabilityMetadata) VulnerabilityMetadataModel

NewVulnerabilityMetadataModel generates a new model from a db.VulnerabilityMetadata struct.

func (*VulnerabilityMetadataModel) Inflate

Inflate generates a db.VulnerabilityMetadataModel object from the serialized model instance.

func (VulnerabilityMetadataModel) TableName

func (VulnerabilityMetadataModel) TableName() string

TableName returns the table which all db.VulnerabilityMetadata model instances are stored into.

type VulnerabilityModel

type VulnerabilityModel struct {
	PK                     uint64 `gorm:"primary_key;auto_increment;"`
	ID                     string `gorm:"column:id"`
	PackageName            string `gorm:"column:package_name; index:get_vulnerability_index"`
	Namespace              string `gorm:"column:namespace; index:get_vulnerability_index"`
	VersionConstraint      string `gorm:"column:version_constraint"`
	VersionFormat          string `gorm:"column:version_format"`
	CPEs                   string `gorm:"column:cpes"`
	RelatedVulnerabilities string `gorm:"column:related_vulnerabilities"`
	FixedInVersions        string `gorm:"column:fixed_in_versions"`
	FixState               string `gorm:"column:fix_state"`
	Advisories             string `gorm:"column:advisories"`
}

VulnerabilityModel is a struct used to serialize db.Vulnerability information into a sqlite3 DB.

func NewVulnerabilityModel

func NewVulnerabilityModel(vulnerability v3.Vulnerability) VulnerabilityModel

NewVulnerabilityModel generates a new model from a db.Vulnerability struct.

func (*VulnerabilityModel) Inflate

func (m *VulnerabilityModel) Inflate() (v3.Vulnerability, error)

Inflate generates a db.Vulnerability object from the serialized model instance.

func (VulnerabilityModel) TableName

func (VulnerabilityModel) TableName() string

TableName returns the table which all db.Vulnerability model instances are stored into.

Jump to

Keyboard shortcuts

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