Documentation ¶
Index ¶
- func New(dbFilePath string, overwrite bool) (*Writer, CleanupFn, error)
- type CleanupFn
- type Writer
- func (s *Writer) AddVulnerability(vulnerabilities ...v3.Vulnerability) error
- func (s *Writer) AddVulnerabilityMetadata(metadata ...v3.VulnerabilityMetadata) error
- func (s *Writer) GetID() (*v3.ID, error)
- func (s *Writer) GetVulnerability(namespace, packageName string) ([]v3.Vulnerability, error)
- func (s *Writer) GetVulnerabilityMetadata(id, namespace string) (*v3.VulnerabilityMetadata, error)
- func (s *Writer) SetID(id v3.ID) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer holds an instance of the database connection
func (*Writer) AddVulnerability ¶
func (s *Writer) AddVulnerability(vulnerabilities ...v3.Vulnerability) error
AddVulnerability saves one or more vulnerabilities into the sqlite3 store.
func (*Writer) AddVulnerabilityMetadata ¶
func (s *Writer) AddVulnerabilityMetadata(metadata ...v3.VulnerabilityMetadata) error
nolint:gocognit AddVulnerabilityMetadata stores one or more vulnerability metadata models into the sqlite DB.
func (*Writer) GetID ¶
GetID fetches the metadata about the databases schema version and build time.
func (*Writer) GetVulnerability ¶
func (s *Writer) GetVulnerability(namespace, packageName string) ([]v3.Vulnerability, error)
GetVulnerability retrieves one or more vulnerabilities given a namespace and package name.
func (*Writer) GetVulnerabilityMetadata ¶
func (s *Writer) GetVulnerabilityMetadata(id, namespace string) (*v3.VulnerabilityMetadata, error)
GetVulnerabilityMetadata retrieves metadata for the given vulnerability ID relative to a specific record source.
Click to show internal directories.
Click to hide internal directories.