Versions in this module Expand all Collapse all v0 v0.1.0 Jun 13, 2026 Changes in this version + const AttrEdition + const AttrLanguage + const AttrOther + const AttrPart + const AttrProduct + const AttrSoftwareEdition + const AttrTargetHardware + const AttrTargetSoftware + const AttrUpdate + const AttrVendor + const AttrVersion + const CPE22Header + const CPE23Header + const CPE23Version + const NVDCPEDict + const NVDCPEFeedURL + const NVDCPEMatch + const NVDCVERecentURL + const PartApplicationShort + const PartHardwareShort + const PartOSShort + const ValueANY + const ValueNA + var ErrDuplicate = errors.New("duplicate record") + var ErrInvalidData = errors.New("invalid data") + var ErrNotFound = errors.New("record not found") + var ErrStorageDisconnected = errors.New("storage is disconnected") + var PartApplication = &Part + var PartHardware = &Part + var PartOperationSystem = &Part + var ValidPartValues = map[string]bool + func AdvancedMatchCPE(criteria *CPE, target *CPE, options *AdvancedMatchOptions) bool + func BindToFS(w *WFN) string + func BindToURI(w *WFN) string + func CPEDisjoint(a, b *CPE) bool + func CPEEqual(a, b *CPE) bool + func CPESubset(a, b *CPE) bool + func CPESuperset(a, b *CPE) bool + func CPEsToStrings(cpes []*CPE) []string + func ClearDataSources() + func CompareAttributes(source, target string) int + func CompareVersions(v1, v2 string) int + func CompareWFNs(source, target *WFN) map[string]int + func ConvertFSToURI(fs string) (string, error) + func ConvertURIToFS(uri string) (string, error) + func ExportDictionary(dict *CPEDictionary, w io.Writer) error + func ExtractCVEsFromText(text string) []string + func FSStringToURI(fs string) string + func FormatCPE(cpe *CPE, version string) (string, error) + func FormatCpe22(cpe *CPE) string + func FormatCpe23(cpe *CPE) string + func FormatURI(cpe *CPE) string + func GetPartName(shortName string) string + func GetRecentCVEs(cveIDs []string, years int) []string + func GroupCVEsByYear(cveIDs []string) map[string][]string + func IsCPE22String(s string) bool + func IsCPE23String(s string) bool + func IsInvalidAttributeError(err error) bool + func IsInvalidFormatError(err error) bool + func IsInvalidPartError(err error) bool + func IsNotFoundError(err error) bool + func IsOperationFailedError(err error) bool + func IsParsingError(err error) bool + func IsSubVersion(parentVersion, subVersion string) bool + func IsVersionInRange(version, minVersion, maxVersion string) bool + func MatchCPE(criteria *CPE, target *CPE, options *MatchOptions) bool + func NormalizeComponent(value string) string + func QueryByCPE(cpe string) ([]string, error) + func QuickMatch(cpeStr1, cpeStr2 string) (bool, error) + func RegisterDataSource(dataSource CPEDataSource) + func RemoveDuplicateCVEs(cveIDs []string) []string + func SortCVEs(cveIDs []string) []string + func URIToFSString(uri string) string + func ValidateCPE(cpe *CPE) error + func ValidateCVE(cveID string) bool + func ValidateComponent(value string, componentName string) error + type ANDExpression struct + Expressions []Expression + func (e *ANDExpression) Evaluate(target *CPE) bool + func (e *ANDExpression) String() string + func (e *ANDExpression) Type() ExpressionType + type AdvancedMatchOptions struct + FieldOptions map[string]FieldMatchOption + IgnoreCase bool + MatchCommonOnly bool + MatchMode string + PartialMatch bool + ScoreThreshold float64 + UseFuzzyMatch bool + UseRegex bool + VersionCompareMode string + VersionLower string + VersionUpper string + func NewAdvancedMatchOptions() *AdvancedMatchOptions + type CPE struct + Cpe23 string + Cve string + Edition Edition + Language Language + Other string + Part Part + ProductName Product + SoftwareEdition string + TargetHardware string + TargetSoftware string + Update Update + Url string + Vendor Vendor + Version Version + func Clone(cpe *CPE) *CPE + func FillDefaults(cpe *CPE) *CPE + func FilterByPart(cpes []*CPE, part *Part) []*CPE + func FilterByProduct(cpes []*CPE, product string) []*CPE + func FilterByVendor(cpes []*CPE, vendor string) []*CPE + func FilterCPEs(cpes []*CPE, expr Expression) []*CPE + func FindVulnerableCPEs(cpes []*CPE, cves []string) []*CPE + func FuzzyGenerateCPE(part, vendor, product, version string) *CPE + func GenerateCPE(part, vendor, product, version string) *CPE + func GenerateFromTemplate(template *CPE, overrides map[string]string) *CPE + func MergeCPEs(primary, secondary *CPE) *CPE + func MustParse(cpeStr string) *CPE + func NormalizeCPE(cpe *CPE) *CPE + func Parse(cpeStr string) (*CPE, error) + func ParseCpe22(cpe22 string) (*CPE, error) + func ParseCpe23(cpe23 string) (*CPE, error) + func ParseOr(cpeStr string, defaultCPE *CPE) *CPE + func ParseURI(uri string) (*CPE, error) + func QueryByCVE(cves []*CVEReference, cveID string) []*CPE + func RandomCPE() *CPE + func Search(cpes []*CPE, criteria *CPE, options *MatchOptions) []*CPE + func StringsToCPEs(strs []string) []*CPE + func (c *CPE) GetURI() string + func (x *CPE) CompareTo(other *CPE) Relation + func (x *CPE) IsDisjointWith(other *CPE) bool + func (x *CPE) IsEqualTo(other *CPE) bool + func (x *CPE) IsSubsetOf(other *CPE) bool + func (x *CPE) IsSupersetOf(other *CPE) bool + func (x *CPE) Match(other *CPE) bool + type CPEBuilder struct + func NewCPEBuilder() *CPEBuilder + func (b *CPEBuilder) Application() *CPEBuilder + func (b *CPEBuilder) Build() (*CPE, error) + func (b *CPEBuilder) BuildWFN() (*WFN, error) + func (b *CPEBuilder) Edition(edition string) *CPEBuilder + func (b *CPEBuilder) Hardware() *CPEBuilder + func (b *CPEBuilder) Language(language string) *CPEBuilder + func (b *CPEBuilder) MustBuild() *CPE + func (b *CPEBuilder) OS() *CPEBuilder + func (b *CPEBuilder) Other(other string) *CPEBuilder + func (b *CPEBuilder) Part(part string) *CPEBuilder + func (b *CPEBuilder) Product(product string) *CPEBuilder + func (b *CPEBuilder) SoftwareEdition(swEdition string) *CPEBuilder + func (b *CPEBuilder) TargetHardware(targetHw string) *CPEBuilder + func (b *CPEBuilder) TargetSoftware(targetSw string) *CPEBuilder + func (b *CPEBuilder) Update(update string) *CPEBuilder + func (b *CPEBuilder) Vendor(vendor string) *CPEBuilder + func (b *CPEBuilder) Version(version string) *CPEBuilder + type CPEDataSource interface + GetCVEInfo func(cveID string) (*CVEReference, error) + QueryByCPE func(cpe string) ([]string, error) + type CPEDictionary struct + GeneratedAt time.Time + Items []*CPEItem + SchemaVersion string + func DownloadAndParseCPEDict(options *NVDFeedOptions) (*CPEDictionary, error) + func ParseDictionary(r io.Reader) (*CPEDictionary, error) + func (d *CPEDictionary) AddItem(item *CPEItem) + func (d *CPEDictionary) FindItemByName(name string) *CPEItem + func (d *CPEDictionary) FindItemsByCriteria(criteria *CPE, options *MatchOptions) []*CPEItem + func (d *CPEDictionary) RemoveItem(name string) bool + type CPEError struct + CPEString string + Err error + Message string + Type ErrorType + func NewInvalidAttributeError(attribute, value string) *CPEError + func NewInvalidFormatError(cpeString string) *CPEError + func NewInvalidPartError(part string) *CPEError + func NewNotFoundError(what string) *CPEError + func NewOperationFailedError(operation string, err error) *CPEError + func NewParsingError(cpeString string, err error) *CPEError + func (e *CPEError) Error() string + func (e *CPEError) Unwrap() error + type CPEExpression struct + CPE *CPE + func (e *CPEExpression) Evaluate(target *CPE) bool + func (e *CPEExpression) String() string + func (e *CPEExpression) Type() ExpressionType + type CPEItem struct + CPE *CPE + Deprecated bool + DeprecationDate *time.Time + Name string + References []Reference + Title string + func NewCPEItem(cpe *CPE, title string) *CPEItem + type CPEMatchData struct + CPEToCVEs map[string][]string + CVEToCPEs map[string][]string + func DownloadAndParseCPEMatch(options *NVDFeedOptions) (*CPEMatchData, error) + type CPESet struct + Description string + Name string + func FromArray(cpes []*CPE, name string, description string) *CPESet + func NewCPESet(name string, description string) *CPESet + func (s *CPESet) Add(cpe *CPE) + func (s *CPESet) AdvancedFilter(criteria *CPE, options *AdvancedMatchOptions) *CPESet + func (s *CPESet) Clear() + func (s *CPESet) Contains(cpe *CPE) bool + func (s *CPESet) Difference(other *CPESet) *CPESet + func (s *CPESet) Equals(other *CPESet) bool + func (s *CPESet) Filter(criteria *CPE, options *MatchOptions) *CPESet + func (s *CPESet) FindRelated(cpe *CPE, options *AdvancedMatchOptions) *CPESet + func (s *CPESet) Intersection(other *CPESet) *CPESet + func (s *CPESet) IsSubsetOf(other *CPESet) bool + func (s *CPESet) IsSupersetOf(other *CPESet) bool + func (s *CPESet) Remove(cpe *CPE) bool + func (s *CPESet) Size() int + func (s *CPESet) Sort(sortBy string, ascending bool) []*CPE + func (s *CPESet) ToSlice() []*CPE + func (s *CPESet) ToString() string + func (s *CPESet) Union(other *CPESet) *CPESet + type CVEReference struct + AffectedCPEs []string + CVEID string + CVSSScore float64 + Description string + LastModifiedDate time.Time + Metadata map[string]interface{} + PublishedDate time.Time + References []string + Severity string + func GetCVEInfo(cves []*CVEReference, cveID string) *CVEReference + func GetCVEInfoImpl(cveID string) (*CVEReference, error) + func NewCVEReference(cveID string) *CVEReference + func QueryByProduct(cves []*CVEReference, vendor, product string, version string) []*CVEReference + func (cve *CVEReference) AddAffectedCPE(cpeURI string) + func (cve *CVEReference) AddReference(reference string) + func (cve *CVEReference) GetMetadata(key string) (interface{}, bool) + func (cve *CVEReference) RemoveAffectedCPE(cpeURI string) bool + func (cve *CVEReference) RemoveMetadata(key string) bool + func (cve *CVEReference) SetMetadata(key string, value interface{}) + func (cve *CVEReference) SetSeverity(cvssScore float64) + type CacheSettings struct + Directory string + Enabled bool + ExpiryHours int + FileNameTemplate string + type Component interface + IsANY func() bool + IsNA func() bool + IsSet func() bool + Normalize func() string + String func() string + type DataSourceAuth struct + APIKey string + Headers map[string]string + Password string + Token string + Username string + type DataSourceType string + const DataSourceCustom + const DataSourceGitHub + const DataSourceMITRE + const DataSourceNVD + const DataSourceOWASP + const DataSourceRedHatCVE + type Edition string + func (e Edition) IsANY() bool + func (e Edition) IsNA() bool + func (e Edition) IsSet() bool + func (e Edition) Normalize() string + func (e Edition) String() string + type ErrorType int + const ErrorTypeInvalidAttribute + const ErrorTypeInvalidFormat + const ErrorTypeInvalidPart + const ErrorTypeNotFound + const ErrorTypeOperationFailed + const ErrorTypeParsingFailed + type Expression interface + Evaluate func(target *CPE) bool + String func() string + Type func() ExpressionType + func ParseExpression(expr string) (Expression, error) + type ExpressionType int + const ExpressionTypeAND + const ExpressionTypeCPE + const ExpressionTypeNOT + const ExpressionTypeOR + type FieldMatchOption struct + MatchMethod string + Required bool + Weight float64 + type FileStorage struct + func NewFileStorage(baseDir string, useCache bool) (*FileStorage, error) + func (f *FileStorage) AdvancedSearchCPE(criteria *CPE, options *AdvancedMatchOptions) ([]*CPE, error) + func (f *FileStorage) DeleteCPE(uri string) error + func (f *FileStorage) SearchCPE(criteria *CPE, options *MatchOptions) ([]*CPE, error) + func (f *FileStorage) UpdateCPE(cpe *CPE) error + func (fs *FileStorage) CPEFilePath(id string) string + func (fs *FileStorage) CVEFilePath(id string) string + func (fs *FileStorage) Close() error + func (fs *FileStorage) DeleteCVE(cveID string) error + func (fs *FileStorage) DictionaryFilePath() string + func (fs *FileStorage) FindCPEsByCVE(cveID string) ([]*CPE, error) + func (fs *FileStorage) FindCVEsByCPE(cpe *CPE) ([]*CVEReference, error) + func (fs *FileStorage) Initialize() error + func (fs *FileStorage) MetadataFilePath(key string) string + func (fs *FileStorage) RetrieveCPE(id string) (*CPE, error) + func (fs *FileStorage) RetrieveCVE(cveID string) (*CVEReference, error) + func (fs *FileStorage) RetrieveDictionary() (*CPEDictionary, error) + func (fs *FileStorage) RetrieveModificationTimestamp(key string) (time.Time, error) + func (fs *FileStorage) SearchCVE(query string, options *SearchOptions) ([]*CVEReference, error) + func (fs *FileStorage) StoreCPE(cpe *CPE) error + func (fs *FileStorage) StoreCVE(cve *CVEReference) error + func (fs *FileStorage) StoreDictionary(dict *CPEDictionary) error + func (fs *FileStorage) StoreModificationTimestamp(key string, timestamp time.Time) error + func (fs *FileStorage) UpdateCVE(cve *CVEReference) error + type Language string + func (l Language) IsANY() bool + func (l Language) IsNA() bool + func (l Language) IsSet() bool + func (l Language) Normalize() string + func (l Language) String() string + type MatchOptions struct + AllowSubVersions bool + IgnoreVersion bool + MaxVersion string + MinVersion string + UseRegex bool + VersionRange bool + func DefaultMatchOptions() *MatchOptions + type MemoryStorage struct + func NewMemoryStorage() *MemoryStorage + func (ms *MemoryStorage) AdvancedSearchCPE(criteria *CPE, options *AdvancedMatchOptions) ([]*CPE, error) + func (ms *MemoryStorage) Close() error + func (ms *MemoryStorage) DeleteCPE(id string) error + func (ms *MemoryStorage) DeleteCVE(cveID string) error + func (ms *MemoryStorage) FindCPEsByCVE(cveID string) ([]*CPE, error) + func (ms *MemoryStorage) FindCVEsByCPE(cpe *CPE) ([]*CVEReference, error) + func (ms *MemoryStorage) Initialize() error + func (ms *MemoryStorage) RetrieveCPE(id string) (*CPE, error) + func (ms *MemoryStorage) RetrieveCVE(cveID string) (*CVEReference, error) + func (ms *MemoryStorage) RetrieveDictionary() (*CPEDictionary, error) + func (ms *MemoryStorage) RetrieveModificationTimestamp(key string) (time.Time, error) + func (ms *MemoryStorage) SearchCPE(criteria *CPE, options *MatchOptions) ([]*CPE, error) + func (ms *MemoryStorage) SearchCVE(query string, options *SearchOptions) ([]*CVEReference, error) + func (ms *MemoryStorage) StoreCPE(cpe *CPE) error + func (ms *MemoryStorage) StoreCVE(cve *CVEReference) error + func (ms *MemoryStorage) StoreDictionary(dict *CPEDictionary) error + func (ms *MemoryStorage) StoreModificationTimestamp(key string, timestamp time.Time) error + func (ms *MemoryStorage) UpdateCPE(cpe *CPE) error + func (ms *MemoryStorage) UpdateCVE(cve *CVEReference) error + type MultiSourceVulnerabilitySearch struct + ConcurrencyLevel int + MergeResults bool + Sources []*VulnDataSource + TimeoutSeconds int + func CreateDefaultMultiSourceSearch() *MultiSourceVulnerabilitySearch + func NewMultiSourceSearch(sources []*VulnDataSource) *MultiSourceVulnerabilitySearch + func (ms *MultiSourceVulnerabilitySearch) SearchByCPE(cpe *CPE) ([]*CVEReference, error) + func (ms *MultiSourceVulnerabilitySearch) SearchByCVE(cveID string) ([]*CVEReference, error) + type NOTExpression struct + Expression Expression + func (e *NOTExpression) Evaluate(target *CPE) bool + func (e *NOTExpression) String() string + func (e *NOTExpression) Type() ExpressionType + type NVDCPEData struct + CPEDictionary *CPEDictionary + CPEMatchData *CPEMatchData + DownloadTime time.Time + func DownloadAllNVDData(options *NVDFeedOptions) (*NVDCPEData, error) + func (data *NVDCPEData) EnrichCPEWithVulnerabilityData(cpe *CPE) + func (data *NVDCPEData) FindCPEsForCVE(cveID string) []*CPE + func (data *NVDCPEData) FindCVEsForCPE(cpe *CPE) []string + type NVDFeedOptions struct + CacheDir string + CacheMaxAge int + HTTPClient *http.Client + MaxConcurrentDownloads int + ShowProgress bool + func DefaultNVDFeedOptions() *NVDFeedOptions + type ORExpression struct + Expressions []Expression + func (e *ORExpression) Evaluate(target *CPE) bool + func (e *ORExpression) String() string + func (e *ORExpression) Type() ExpressionType + type Part struct + Description string + LongName string + ShortName string + func ParsePart(s string) (Part, error) + func StringToPart(s string) (*Part, error) + func (p Part) IsANY() bool + func (p Part) IsNA() bool + func (p Part) IsSet() bool + func (p Part) Normalize() string + type Product string + func (p Product) IsANY() bool + func (p Product) IsNA() bool + func (p Product) IsSet() bool + func (p Product) Normalize() string + func (p Product) String() string + type Reference struct + Type string + URL string + type Relation int + const RelationDisjoint + const RelationEqual + const RelationOverlap + const RelationSubset + const RelationSuperset + const RelationUnknown + func CompareWFNRelation(comparisons map[string]int) Relation + func (r Relation) String() string + type SearchOptions struct + DateEnd *time.Time + DateStart *time.Time + Filters map[string]interface{} + FullTextQuery string + IncludeDeprecated bool + Limit int + MaxCVSS float64 + MinCVSS float64 + Offset int + SortAscending bool + SortBy string + func NewSearchOptions() *SearchOptions + type Storage interface + AdvancedSearchCPE func(criteria *CPE, options *AdvancedMatchOptions) ([]*CPE, error) + Close func() error + DeleteCPE func(id string) error + DeleteCVE func(cveID string) error + FindCPEsByCVE func(cveID string) ([]*CPE, error) + FindCVEsByCPE func(cpe *CPE) ([]*CVEReference, error) + Initialize func() error + RetrieveCPE func(id string) (*CPE, error) + RetrieveCVE func(cveID string) (*CVEReference, error) + RetrieveDictionary func() (*CPEDictionary, error) + RetrieveModificationTimestamp func(key string) (time.Time, error) + SearchCPE func(criteria *CPE, options *MatchOptions) ([]*CPE, error) + SearchCVE func(query string, options *SearchOptions) ([]*CVEReference, error) + StoreCPE func(cpe *CPE) error + StoreCVE func(cve *CVEReference) error + StoreDictionary func(dict *CPEDictionary) error + StoreModificationTimestamp func(key string, timestamp time.Time) error + UpdateCPE func(cpe *CPE) error + UpdateCVE func(cve *CVEReference) error + type StorageManager struct + Cache Storage + CacheEnabled bool + CacheTTLSeconds int + Primary Storage + func NewStorageManager(primary Storage) *StorageManager + func (sm *StorageManager) AdvancedSearch(criteria *CPE, options *AdvancedMatchOptions) ([]*CPE, error) + func (sm *StorageManager) ClearCache() error + func (sm *StorageManager) GetCPE(id string) (*CPE, error) + func (sm *StorageManager) GetCVE(cveID string) (*CVEReference, error) + func (sm *StorageManager) GetStats() (*StorageStats, error) + func (sm *StorageManager) InvalidateCache(id string) + func (sm *StorageManager) Search(criteria *CPE, options *MatchOptions) ([]*CPE, error) + func (sm *StorageManager) SetCache(cache Storage) + func (sm *StorageManager) StoreCPE(cpe *CPE) error + type StorageStats struct + LastUpdated time.Time + StorageBytes int64 + TotalCPEs int + TotalCVEs int + TotalDictionaryItems int + type Update string + func (u Update) IsANY() bool + func (u Update) IsNA() bool + func (u Update) IsSet() bool + func (u Update) Normalize() string + func (u Update) String() string + type Vendor string + func (v Vendor) IsANY() bool + func (v Vendor) IsNA() bool + func (v Vendor) IsSet() bool + func (v Vendor) Normalize() string + func (v Vendor) String() string + type Version string + func (v Version) IsANY() bool + func (v Version) IsNA() bool + func (v Version) IsSet() bool + func (v Version) Normalize() string + func (v Version) String() string + type VersionRange struct + MaxVersion string + MinVersion string + func ParseVersionRange(s string) (*VersionRange, error) + func (vr *VersionRange) Contains(version string) bool + type VulnDataSource struct + Authentication *DataSourceAuth + CacheSettings *CacheSettings + Client *http.Client + Description string + LastUpdated time.Time + Name string + Options map[string]interface{} + Type DataSourceType + URL string + func CreateGitHubDataSource(token string) *VulnDataSource + func CreateNVDDataSource(apiKey string) *VulnDataSource + func CreateRedHatDataSource() *VulnDataSource + func NewVulnDataSource(sourceType DataSourceType, name, description, url string) *VulnDataSource + func (ds *VulnDataSource) FetchData(endpoint string) ([]byte, error) + func (ds *VulnDataSource) GetVulnerabilities(params map[string]string) ([]*CVEReference, error) + func (ds *VulnDataSource) GetVulnerabilityById(cveID string) (*CVEReference, error) + func (ds *VulnDataSource) SearchVulnerabilitiesByCPE(cpe *CPE) ([]*CVEReference, error) + func (ds *VulnDataSource) SetAuthentication(auth *DataSourceAuth) + func (ds *VulnDataSource) SetCacheSettings(cache *CacheSettings) + type WFN struct + Edition string + Language string + Other string + Part string + Product string + SoftwareEdition string + TargetHardware string + TargetSoftware string + Update string + Vendor string + Version string + func FromCPE(cpe *CPE) *WFN + func FromCPE22String(cpe22 string) (*WFN, error) + func FromCPE23String(cpe23 string) (*WFN, error) + func NewWFN() *WFN + func UnbindFS(fs string) (*WFN, error) + func UnbindURI(uri string) (*WFN, error) + func (w *WFN) Get(attr string) string + func (w *WFN) IsIdentifierName() bool + func (w *WFN) Match(other *WFN) bool + func (w *WFN) Set(attr string, value string) + func (w *WFN) ToCPE() *CPE + func (w *WFN) ToCPE22String() string + func (w *WFN) ToCPE23String() string + func (w *WFN) WFNString() string + type XMLCPEDictionary struct + GeneratedAt string + Items []XMLCPEItem + SchemaVersion string + XMLName xml.Name + type XMLCPEItem struct + Deprecated string + DeprecationDate string + Name string + References []XMLReference + Title string + XMLName xml.Name + type XMLReference struct + Type string + URL string