model

package
v0.59.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VulnerabilityTableName    = "vulnerability"
	GetVulnerabilityIndexName = "get_vulnerability_index"
)
View Source
const (
	VulnerabilityMatchExclusionTableName    = "vulnerability_match_exclusion"
	GetVulnerabilityMatchExclusionIndexName = "get_vulnerability_match_exclusion_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 v5.ID) IDModel

func (*IDModel) Inflate

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

func (IDModel) TableName

func (IDModel) TableName() string

type VulnerabilityMatchExclusionModel

type VulnerabilityMatchExclusionModel struct {
	PK            uint64            `gorm:"primary_key;auto_increment;"`
	ID            string            `gorm:"column:id; index:get_vulnerability_match_exclusion_index"`
	Constraints   sqlite.NullString `gorm:"column:constraints; default:null"`
	Justification string            `gorm:"column:justification"`
}

VulnerabilityMatchExclusionModel is a struct used to serialize db.VulnerabilityMatchExclusion information into a sqlite3 DB.

func NewVulnerabilityMatchExclusionModel

func NewVulnerabilityMatchExclusionModel(v v5.VulnerabilityMatchExclusion) VulnerabilityMatchExclusionModel

NewVulnerabilityMatchExclusionModel generates a new model from a db.VulnerabilityMatchExclusion struct.

func (*VulnerabilityMatchExclusionModel) Inflate

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

func (VulnerabilityMatchExclusionModel) TableName

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

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         sqlite.NullString `gorm:"column:urls; default:null"`
	Description  string            `gorm:"column:description"`
	Cvss         sqlite.NullString `gorm:"column:cvss; default:null"`
}

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

func NewVulnerabilityMetadataModel

func NewVulnerabilityMetadataModel(metadata v5.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"`
	PackageQualifiers      sqlite.NullString `gorm:"column:package_qualifiers"`
	VersionConstraint      string            `gorm:"column:version_constraint"`
	VersionFormat          string            `gorm:"column:version_format"`
	CPEs                   sqlite.NullString `gorm:"column:cpes; default:null"`
	RelatedVulnerabilities sqlite.NullString `gorm:"column:related_vulnerabilities; default:null"`
	FixedInVersions        sqlite.NullString `gorm:"column:fixed_in_versions; default:null"`
	FixState               string            `gorm:"column:fix_state"`
	Advisories             sqlite.NullString `gorm:"column:advisories; default:null"`
}

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

func NewVulnerabilityModel

func NewVulnerabilityModel(vulnerability v5.Vulnerability) VulnerabilityModel

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

func (*VulnerabilityModel) Inflate

func (m *VulnerabilityModel) Inflate() (v5.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