Documentation ¶
Index ¶
- type DB
- type RDBDriver
- func (r *RDBDriver) CloseDB() (err error)
- func (r *RDBDriver) CountNvd() (int, error)
- func (r *RDBDriver) Get(cveID string) (*models.CveDetail, error)
- func (r *RDBDriver) GetByCpeURI(uri string) ([]models.CveDetail, error)
- func (r *RDBDriver) GetCveIDsByCpeURI(uri string) ([]string, error)
- func (r *RDBDriver) GetFetchedFeedMeta(url string) (*models.FeedMeta, error)
- func (r *RDBDriver) GetFetchedFeedMetas() ([]models.FeedMeta, error)
- func (r *RDBDriver) GetMulti(cveIDs []string) (map[string]models.CveDetail, error)
- func (r *RDBDriver) InsertJvn(cves []models.CveDetail) error
- func (r *RDBDriver) InsertNvdJSON(cves []models.CveDetail) (err error)
- func (r *RDBDriver) MigrateDB() error
- func (r *RDBDriver) Name() string
- func (r *RDBDriver) OpenDB(dbType, dbPath string, debugSQL bool) (locked bool, err error)
- func (r *RDBDriver) UpsertFeedHash(mm models.FeedMeta) error
- type RedisDriver
- func (r *RedisDriver) CloseDB() (err error)
- func (r *RedisDriver) CountNvd() (int, error)
- func (r *RedisDriver) Get(cveID string) (*models.CveDetail, error)
- func (r *RedisDriver) GetByCpeURI(uri string) ([]models.CveDetail, error)
- func (r *RedisDriver) GetCveIDsByCpeURI(uri string) ([]string, error)
- func (r *RedisDriver) GetFetchedFeedMeta(url string) (*models.FeedMeta, error)
- func (r *RedisDriver) GetFetchedFeedMetas() (metas []models.FeedMeta, err error)
- func (r *RedisDriver) GetMulti(cveIDs []string) (map[string]models.CveDetail, error)
- func (r *RedisDriver) InsertJvn(cves []models.CveDetail) error
- func (r *RedisDriver) InsertNvdJSON(cves []models.CveDetail) error
- func (r *RedisDriver) Name() string
- func (r *RedisDriver) OpenDB(dbType, dbPath string, debugSQL bool) (err error)
- func (r *RedisDriver) UpsertFeedHash(m models.FeedMeta) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Name() string CloseDB() error Get(string) (*models.CveDetail, error) GetMulti([]string) (map[string]models.CveDetail, error) GetCveIDsByCpeURI(string) ([]string, error) GetByCpeURI(string) ([]models.CveDetail, error) InsertJvn([]models.CveDetail) error InsertNvdJSON([]models.CveDetail) error CountNvd() (int, error) UpsertFeedHash(models.FeedMeta) error GetFetchedFeedMeta(string) (*models.FeedMeta, error) GetFetchedFeedMetas() ([]models.FeedMeta, error) }
DB is interface for a database driver
type RDBDriver ¶
type RDBDriver struct {
// contains filtered or unexported fields
}
RDBDriver is Driver for RDB
func (*RDBDriver) GetByCpeURI ¶
GetByCpeURI Select Cve information from DB.
func (*RDBDriver) GetCveIDsByCpeURI ¶
GetCveIDsByCpeURI Select Cve Ids by by pseudo-CPE
func (*RDBDriver) GetFetchedFeedMeta ¶
GetFetchedFeedMeta selects fetchmeta of the year
func (*RDBDriver) GetFetchedFeedMetas ¶
GetFetchedFeedMetas selects a list of FeedMeta
func (*RDBDriver) InsertNvdJSON ¶
InsertNvdJSON Cve information from DB.
type RedisDriver ¶
type RedisDriver struct {
// contains filtered or unexported fields
}
RedisDriver is Driver for Redis
func NewRedis ¶
func NewRedis(dbType, dbpath string, debugSQL bool) (driver *RedisDriver, locked bool, err error)
NewRedis return Redis driver
func (*RedisDriver) CountNvd ¶
func (r *RedisDriver) CountNvd() (int, error)
CountNvd count nvd table
func (*RedisDriver) Get ¶
func (r *RedisDriver) Get(cveID string) (*models.CveDetail, error)
Get Select Cve information from DB.
func (*RedisDriver) GetByCpeURI ¶
func (r *RedisDriver) GetByCpeURI(uri string) ([]models.CveDetail, error)
GetByCpeURI Select Cve information from DB.
func (*RedisDriver) GetCveIDsByCpeURI ¶
func (r *RedisDriver) GetCveIDsByCpeURI(uri string) ([]string, error)
GetCveIDsByCpeURI Select Cve Ids by by pseudo-CPE
func (*RedisDriver) GetFetchedFeedMeta ¶
func (r *RedisDriver) GetFetchedFeedMeta(url string) (*models.FeedMeta, error)
GetFetchedFeedMeta selects hash in metafile of the year
func (*RedisDriver) GetFetchedFeedMetas ¶
func (r *RedisDriver) GetFetchedFeedMetas() (metas []models.FeedMeta, err error)
GetFetchedFeedMetas selects a list of FeedMeta
func (*RedisDriver) InsertJvn ¶
func (r *RedisDriver) InsertJvn(cves []models.CveDetail) error
InsertJvn insert items fetched from JVN.
func (*RedisDriver) InsertNvdJSON ¶
func (r *RedisDriver) InsertNvdJSON(cves []models.CveDetail) error
InsertNvdJSON Cve information from DB.
func (*RedisDriver) OpenDB ¶
func (r *RedisDriver) OpenDB(dbType, dbPath string, debugSQL bool) (err error)
OpenDB opens Database
func (*RedisDriver) UpsertFeedHash ¶
func (r *RedisDriver) UpsertFeedHash(m models.FeedMeta) error
UpsertFeedHash selects hash in metafile of the year