Documentation ¶
Index ¶
- Variables
- type DB
- type Option
- type RDBDriver
- func (r *RDBDriver) CloseDB() (err error)
- func (r *RDBDriver) GetCpesByVendorProduct(vendor, product string) ([]string, []string, error)
- func (r *RDBDriver) GetFetchMeta() (fetchMeta *models.FetchMeta, err error)
- func (r *RDBDriver) GetSimilarCpesByTitle(query string, n int, algorithm edlib.Algorithm) ([]models.FetchedCPE, error)
- func (r *RDBDriver) GetVendorProducts() ([]models.VendorProduct, []models.VendorProduct, error)
- func (r *RDBDriver) InsertCpes(fetchType models.FetchType, cpes models.FetchedCPEs) error
- func (r *RDBDriver) IsDeprecated(_ string) (bool, error)
- func (r *RDBDriver) IsGoCPEDictModelV1() (bool, error)
- func (r *RDBDriver) MigrateDB() error
- func (r *RDBDriver) Name() string
- func (r *RDBDriver) OpenDB(dbType, dbPath string, debugSQL bool, _ Option) (err error)
- func (r *RDBDriver) UpsertFetchMeta(fetchMeta *models.FetchMeta) error
- type RedisDriver
- func (r *RedisDriver) CloseDB() error
- func (r *RedisDriver) GetCpesByVendorProduct(vendor, product string) ([]string, []string, error)
- func (r *RedisDriver) GetFetchMeta() (*models.FetchMeta, error)
- func (r *RedisDriver) GetSimilarCpesByTitle(query string, n int, algorithm edlib.Algorithm) ([]models.FetchedCPE, error)
- func (r *RedisDriver) GetVendorProducts() ([]models.VendorProduct, []models.VendorProduct, error)
- func (r *RedisDriver) InsertCpes(fetchType models.FetchType, cpes models.FetchedCPEs) (err error)
- func (r *RedisDriver) IsDeprecated(cpeURI string) (bool, error)
- func (r *RedisDriver) IsGoCPEDictModelV1() (bool, error)
- func (r *RedisDriver) MigrateDB() error
- func (r *RedisDriver) Name() string
- func (r *RedisDriver) OpenDB(_, dbPath string, _ bool, option Option) error
- func (r *RedisDriver) UpsertFetchMeta(fetchMeta *models.FetchMeta) error
Constants ¶
This section is empty.
Variables ¶
var ErrDBLocked = xerrors.New("database is locked")
ErrDBLocked :
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB interface { Name() string OpenDB(dbType, dbPath string, debugSQL bool, option Option) error CloseDB() error MigrateDB() error IsGoCPEDictModelV1() (bool, error) GetFetchMeta() (*models.FetchMeta, error) UpsertFetchMeta(*models.FetchMeta) error GetVendorProducts() ([]models.VendorProduct, []models.VendorProduct, error) GetCpesByVendorProduct(string, string) ([]string, []string, error) GetSimilarCpesByTitle(string, int, edlib.Algorithm) ([]models.FetchedCPE, error) InsertCpes(models.FetchType, models.FetchedCPEs) error IsDeprecated(string) (bool, 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) GetCpesByVendorProduct ¶
GetCpesByVendorProduct : GetCpesByVendorProduct
func (*RDBDriver) GetFetchMeta ¶ added in v0.4.0
GetFetchMeta get FetchMeta from Database
func (*RDBDriver) GetSimilarCpesByTitle ¶ added in v0.5.3
func (r *RDBDriver) GetSimilarCpesByTitle(query string, n int, algorithm edlib.Algorithm) ([]models.FetchedCPE, error)
GetSimilarCpesByTitle : GetSimilarCpesByTitle
func (*RDBDriver) GetVendorProducts ¶
func (r *RDBDriver) GetVendorProducts() ([]models.VendorProduct, []models.VendorProduct, error)
GetVendorProducts : GetVendorProducts
func (*RDBDriver) InsertCpes ¶
InsertCpes inserts Cpe Information into DB
func (*RDBDriver) IsDeprecated ¶
IsDeprecated : IsDeprecated
func (*RDBDriver) IsGoCPEDictModelV1 ¶ added in v0.4.0
IsGoCPEDictModelV1 determines if the DB was created at the time of go-cpe-dictionary Model v1
type RedisDriver ¶
type RedisDriver struct {
// contains filtered or unexported fields
}
RedisDriver is Driver for Redis
func (*RedisDriver) GetCpesByVendorProduct ¶
func (r *RedisDriver) GetCpesByVendorProduct(vendor, product string) ([]string, []string, error)
GetCpesByVendorProduct : GetCpesByVendorProduct
func (*RedisDriver) GetFetchMeta ¶ added in v0.4.0
func (r *RedisDriver) GetFetchMeta() (*models.FetchMeta, error)
GetFetchMeta get FetchMeta from Database
func (*RedisDriver) GetSimilarCpesByTitle ¶ added in v0.5.3
func (r *RedisDriver) GetSimilarCpesByTitle(query string, n int, algorithm edlib.Algorithm) ([]models.FetchedCPE, error)
GetSimilarCpesByTitle : GetSimilarCpesByTitle
func (*RedisDriver) GetVendorProducts ¶
func (r *RedisDriver) GetVendorProducts() ([]models.VendorProduct, []models.VendorProduct, error)
GetVendorProducts : GetVendorProducts
func (*RedisDriver) InsertCpes ¶
func (r *RedisDriver) InsertCpes(fetchType models.FetchType, cpes models.FetchedCPEs) (err error)
InsertCpes Select Cve information from DB.
func (*RedisDriver) IsDeprecated ¶
func (r *RedisDriver) IsDeprecated(cpeURI string) (bool, error)
IsDeprecated : IsDeprecated
func (*RedisDriver) IsGoCPEDictModelV1 ¶ added in v0.4.0
func (r *RedisDriver) IsGoCPEDictModelV1() (bool, error)
IsGoCPEDictModelV1 determines if the DB was created at the time of go-cpe-dictionary Model v1
func (*RedisDriver) OpenDB ¶
func (r *RedisDriver) OpenDB(_, dbPath string, _ bool, option Option) error
OpenDB opens Database
func (*RedisDriver) UpsertFetchMeta ¶ added in v0.4.0
func (r *RedisDriver) UpsertFetchMeta(fetchMeta *models.FetchMeta) error
UpsertFetchMeta upsert FetchMeta to Database