Documentation ¶
Index ¶
Constants ¶
const ( VulnerabilityTableName = "vulnerability" GetVulnerabilityIndexName = "get_vulnerability_index" )
const (
IDTableName = "id"
)
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 ¶
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 ¶
func (m *VulnerabilityMetadataModel) Inflate() (v3.VulnerabilityMetadata, error)
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.