models

package
v0.0.0-...-44f477e Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CVEAllowlist

type CVEAllowlist struct {
	ID           int64              `orm:"pk;auto;column(id)" json:"id,omitempty"`
	ProjectID    int64              `orm:"column(project_id)" json:"project_id"`
	ExpiresAt    *int64             `orm:"column(expires_at)" json:"expires_at,omitempty"`
	Items        []CVEAllowlistItem `orm:"-" json:"items"`
	ItemsText    string             `orm:"column(items)" json:"-"`
	CreationTime time.Time          `orm:"column(creation_time);auto_now_add"`
	UpdateTime   time.Time          `orm:"column(update_time);auto_now"`
}

CVEAllowlist defines the data model for a CVE allowlist

func (*CVEAllowlist) CVESet

func (c *CVEAllowlist) CVESet() CVESet

CVESet returns the set of CVE id of the items in the allowlist to help filter the vulnerability list

func (*CVEAllowlist) IsExpired

func (c *CVEAllowlist) IsExpired() bool

IsExpired returns whether the allowlist is expired

func (*CVEAllowlist) TableName

func (c *CVEAllowlist) TableName() string

TableName ...

type CVEAllowlistItem

type CVEAllowlistItem struct {
	CVEID string `json:"cve_id"`
}

CVEAllowlistItem defines one item in the CVE allowlist

type CVESet

type CVESet map[string]struct{}

CVESet defines the CVE allowlist with a hash set way for easy query.

func NewCVESet

func NewCVESet(cveSets ...CVESet) CVESet

NewCVESet returns CVESet from cveSets

func (CVESet) Add

func (cs CVESet) Add(cve string)

Add add cve to the set

func (CVESet) Contains

func (cs CVESet) Contains(cve string) bool

Contains checks whether the specified CVE is in the set or not.

Jump to

Keyboard shortcuts

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