db

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearIDRedhat

func ClearIDRedhat(cve *models.RedhatCVE)

func ConvertDebian

func ConvertDebian(cveJSONs models.DebianJSON) (cves []models.DebianCVE)

func ConvertMicrosoft added in v0.1.5

func ConvertMicrosoft(cveXMLs []models.MicrosoftXML, cveXls []models.MicrosoftBulletinSearch) (cves []models.MicrosoftCVE, msProducts []models.MicrosoftProduct)

ConvertMicrosoft :

func ConvertRedhat

func ConvertRedhat(cveJSONs []models.RedhatCVEJSON) (cves []models.RedhatCVE, err error)

Types

type DB

type DB interface {
	Name() string
	OpenDB(string, string, bool) (bool, error)
	MigrateDB() error

	GetAfterTimeRedhat(time.Time) ([]models.RedhatCVE, error)
	GetRedhat(string) *models.RedhatCVE
	GetRedhatMulti([]string) map[string]models.RedhatCVE
	GetDebian(string) *models.DebianCVE
	GetMicrosoft(string) *models.MicrosoftCVE
	GetMicrosoftMulti([]string) map[string]models.MicrosoftCVE
	GetUnfixedCvesRedhat(string, string, bool) map[string]models.RedhatCVE
	GetUnfixedCvesDebian(string, string) map[string]models.DebianCVE

	InsertRedhat([]models.RedhatCVEJSON) error
	InsertDebian(models.DebianJSON) error
	InsertMicrosoft([]models.MicrosoftXML, []models.MicrosoftBulletinSearch) error
}

DB is interface for a database driver

func NewDB

func NewDB(dbType, dbPath string, debugSQL bool) (driver DB, locked bool, err error)

NewDB returns db driver

type RDBDriver

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

RDBDriver is Driver for RDB

func (*RDBDriver) GetAfterTimeRedhat

func (r *RDBDriver) GetAfterTimeRedhat(after time.Time) (allCves []models.RedhatCVE, err error)

func (*RDBDriver) GetDebian

func (r *RDBDriver) GetDebian(cveID string) *models.DebianCVE

func (*RDBDriver) GetMicrosoft added in v0.1.5

func (r *RDBDriver) GetMicrosoft(cveID string) *models.MicrosoftCVE

GetMicrosoft :

func (*RDBDriver) GetMicrosoftMulti added in v0.1.5

func (r *RDBDriver) GetMicrosoftMulti(cveIDs []string) map[string]models.MicrosoftCVE

GetMicrosoftMulti :

func (*RDBDriver) GetRedhat

func (r *RDBDriver) GetRedhat(cveID string) *models.RedhatCVE

func (*RDBDriver) GetRedhatMulti

func (r *RDBDriver) GetRedhatMulti(cveIDs []string) map[string]models.RedhatCVE

func (*RDBDriver) GetUnfixedCvesDebian

func (r *RDBDriver) GetUnfixedCvesDebian(major, pkgName string) map[string]models.DebianCVE

func (*RDBDriver) GetUnfixedCvesMicrosoft added in v0.1.5

func (r *RDBDriver) GetUnfixedCvesMicrosoft(major, pkgName string, detectWillNotFix ...bool) map[string]models.MicrosoftCVE

GetUnfixedCvesMicrosoft :

func (*RDBDriver) GetUnfixedCvesRedhat

func (r *RDBDriver) GetUnfixedCvesRedhat(major, pkgName string, ignoreWillNotFix bool) map[string]models.RedhatCVE

func (*RDBDriver) InsertDebian

func (r *RDBDriver) InsertDebian(cveJSON models.DebianJSON) (err error)

func (*RDBDriver) InsertMicrosoft added in v0.1.5

func (r *RDBDriver) InsertMicrosoft(cveJSON []models.MicrosoftXML, cveXls []models.MicrosoftBulletinSearch) (err error)

InsertMicrosoft :

func (*RDBDriver) InsertRedhat

func (r *RDBDriver) InsertRedhat(cveJSONs []models.RedhatCVEJSON) (err error)

func (*RDBDriver) MigrateDB

func (r *RDBDriver) MigrateDB() error

MigrateDB migrates Database

func (*RDBDriver) Name

func (r *RDBDriver) Name() string

Name return db name

func (*RDBDriver) OpenDB

func (r *RDBDriver) OpenDB(dbType, dbPath string, debugSQL bool) (locked bool, err error)

OpenDB opens Database

type RedisDriver

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

RedisDriver is Driver for Redis

func (*RedisDriver) GetAfterTimeRedhat

func (r *RedisDriver) GetAfterTimeRedhat(time.Time) ([]models.RedhatCVE, error)

GetAfterTimeRedhat :

func (*RedisDriver) GetDebian

func (r *RedisDriver) GetDebian(cveID string) *models.DebianCVE

GetDebian :

func (*RedisDriver) GetMicrosoft added in v0.1.5

func (r *RedisDriver) GetMicrosoft(cveID string) *models.MicrosoftCVE

GetMicrosoft :

func (*RedisDriver) GetMicrosoftMulti added in v0.1.5

func (r *RedisDriver) GetMicrosoftMulti(cveIDs []string) map[string]models.MicrosoftCVE

GetMicrosoftMulti :

func (*RedisDriver) GetRedhat

func (r *RedisDriver) GetRedhat(cveID string) *models.RedhatCVE

GetRedhat :

func (*RedisDriver) GetRedhatMulti

func (r *RedisDriver) GetRedhatMulti(cveIDs []string) map[string]models.RedhatCVE

GetRedhatMulti :

func (*RedisDriver) GetUnfixedCvesDebian

func (r *RedisDriver) GetUnfixedCvesDebian(major, pkgName string) (m map[string]models.DebianCVE)

GetUnfixedCvesDebian :

func (*RedisDriver) GetUnfixedCvesRedhat

func (r *RedisDriver) GetUnfixedCvesRedhat(major, pkgName string, ignoreWillNotFix bool) (m map[string]models.RedhatCVE)

GetUnfixedCvesRedhat :

func (*RedisDriver) InsertDebian

func (r *RedisDriver) InsertDebian(cveJSONs models.DebianJSON) error

InsertDebian :

func (*RedisDriver) InsertMicrosoft added in v0.1.5

func (r *RedisDriver) InsertMicrosoft(cveXMLs []models.MicrosoftXML, xls []models.MicrosoftBulletinSearch) (err error)

InsertMicrosoft :

func (*RedisDriver) InsertRedhat

func (r *RedisDriver) InsertRedhat(cveJSONs []models.RedhatCVEJSON) (err error)

InsertRedhat :

func (*RedisDriver) MigrateDB

func (r *RedisDriver) MigrateDB() error

MigrateDB migrates Database

func (*RedisDriver) Name

func (r *RedisDriver) Name() string

Name return db name

func (*RedisDriver) OpenDB

func (r *RedisDriver) OpenDB(dbType, dbPath string, debugSQL bool) (locked bool, err error)

OpenDB opens Database

Jump to

Keyboard shortcuts

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