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 ¶ added in v0.1.1
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 ¶ added in v0.1.1
type RDBDriver struct {
// contains filtered or unexported fields
}
RDBDriver is Driver for RDB
func (*RDBDriver) GetByCpeURI ¶ added in v0.2.0
GetByCpeURI Select Cve information from DB.
func (*RDBDriver) GetCveIDsByCpeURI ¶ added in v0.4.0
GetCveIDsByCpeURI Select Cve Ids by by pseudo-CPE
func (*RDBDriver) GetFetchedFeedMeta ¶ added in v0.2.0
GetFetchedFeedMeta selects fetchmeta of the year
func (*RDBDriver) GetFetchedFeedMetas ¶ added in v0.2.0
GetFetchedFeedMetas selects a list of FeedMeta
func (*RDBDriver) InsertNvdJSON ¶ added in v0.2.0
InsertNvdJSON Cve information from DB.
type RedisDriver ¶ added in v0.1.1
type RedisDriver struct {
// contains filtered or unexported fields
}
RedisDriver is Driver for Redis
func NewRedis ¶ added in v0.2.0
func NewRedis(dbType, dbpath string, debugSQL bool) (driver *RedisDriver, locked bool, err error)
NewRedis return Redis driver
func (*RedisDriver) CloseDB ¶ added in v0.2.0
func (r *RedisDriver) CloseDB() (err error)
CloseDB close Database
func (*RedisDriver) CountNvd ¶ added in v0.1.1
func (r *RedisDriver) CountNvd() (int, error)
CountNvd count nvd table
func (*RedisDriver) Get ¶ added in v0.1.1
func (r *RedisDriver) Get(cveID string) (*models.CveDetail, error)
Get Select Cve information from DB.
func (*RedisDriver) GetByCpeURI ¶ added in v0.2.0
func (r *RedisDriver) GetByCpeURI(uri string) ([]models.CveDetail, error)
GetByCpeURI Select Cve information from DB.
func (*RedisDriver) GetCveIDsByCpeURI ¶ added in v0.4.0
func (r *RedisDriver) GetCveIDsByCpeURI(uri string) ([]string, error)
GetCveIDsByCpeURI Select Cve Ids by by pseudo-CPE
func (*RedisDriver) GetFetchedFeedMeta ¶ added in v0.2.0
func (r *RedisDriver) GetFetchedFeedMeta(url string) (*models.FeedMeta, error)
GetFetchedFeedMeta selects hash in metafile of the year
func (*RedisDriver) GetFetchedFeedMetas ¶ added in v0.2.0
func (r *RedisDriver) GetFetchedFeedMetas() (metas []models.FeedMeta, err error)
GetFetchedFeedMetas selects a list of FeedMeta
func (*RedisDriver) InsertJvn ¶ added in v0.1.1
func (r *RedisDriver) InsertJvn(cves []models.CveDetail) error
InsertJvn insert items fetched from JVN.
func (*RedisDriver) InsertNvdJSON ¶ added in v0.2.0
func (r *RedisDriver) InsertNvdJSON(cves []models.CveDetail) error
InsertNvdJSON Cve information from DB.
func (*RedisDriver) OpenDB ¶ added in v0.1.1
func (r *RedisDriver) OpenDB(dbType, dbPath string, debugSQL bool) (err error)
OpenDB opens Database
func (*RedisDriver) UpsertFeedHash ¶ added in v0.2.0
func (r *RedisDriver) UpsertFeedHash(m models.FeedMeta) error
UpsertFeedHash selects hash in metafile of the year