package
0.0.0-20241217140921-6642097e0988
Repository: https://github.com/shlin168/go-nvd.git
Documentation: pkg.go.dev
# Packages
No description provided by the author
# Functions
GetQueryConfig gets the query config with given options, use default value in Config if not specified.
IsNotFound checks whether the error belongs to data not found in database.
IsPageEnd checks whether the error belongs to page end.
IsUnexpectedError checkes whether the error belongs to unexpected error in database.
MongoClientOptions appends additional mongo options to client.
MongoConfig is expected to use only in testing to mock the client.
MongoGetURI overwrites default function to get uri to connect to database.
MongoTestClient is expected to use only in testing to mock the client.
NewConfig initializes config with default value.
NewMongo initializes db client to interact with mongo db.
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
CltCve and CltCpe are collection name in 'DBNvd'.
DBNvd is the database name of nvd service.
DefaultTimeout is the default timeout for each db operation.
GetSizeUnlimited is the constant to indicate that there's no size limit for db return record size.
No description provided by the author
No description provided by the author
# Variables
DefaultGetMongoURI is the url template to connect to local testing mongo db, query string of URI might be different when connecting to db with different authenication method.
ErrNotFound is general not found error for all structs that implement Nvd[Cve|Cpe]DB interface It is expected to return this error if the input is not found in the table.
ErrPageEnd is the error to indicate that the start index is larger than the total number of entries.
# Structs
Config is the general(default) config to initialize the collection or control the db logic.
Keyword defines how a keyword matches with the description of CVE or CPE.
Mongo is the db client to handle mongo db operations.
QueryConfig is the config for each DB query Use options to stay flexible for future extension.
Result is the result of a query, including the total number of entries, the start index, the size of the result.
# Interfaces
DB is the interface to record information and handle general operations such as connect and disconnect to database.
NvdCpeDB is the interface to define the operations related to NVD API for CPE.
NvdCveDB is the interface to define the operations related to NVD API for CVE.
NVDUnit is the interface to define the possible type of response, which is either CVE or CPE.
# Type aliases
MongoOptions is the options of Mongo client.
No description provided by the author