db

package
v1.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBCheck

func DBCheck(skipDbUpdate bool, forceDbUpdate bool)

Check if database file and metadata is exist from the local path, * when files are existing, it will check the latest version from the global metadata and it will compare from the local version to determine if needed to update.

func FindByKeywords added in v1.2.0

func FindByKeywords(keywords *[]string, vulnerabilities *[]types.Vulnerability)

FindPackage is a function that accepts a list of keywords and a list of Vulnerability structs. It uses the bun package to query the database for vulnerabilities that match any of the keywords. If there is an error while querying the database, the function logs the error as fatal.

Types

type Metadata

type Metadata struct {
	Build    int64  `json:"build,omitempty"`
	Schema   string `json:"schema,omitempty"`
	URL      string `json:"url,omitempty"`
	Checksum string `json:"checksum,omitempty"`
}

func GetLocalMetadata

func GetLocalMetadata() Metadata

Check and read the metadata from user cache directory.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL