writer

package
v0.34.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(dbFilePath string, overwrite bool) (*Writer, CleanupFn, error)

New creates a new instance of the store.

Types

type CleanupFn

type CleanupFn func() error

CleanupFn is a callback for closing a DB connection.

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

func (s *Writer) GetID() (*v3.ID, error)

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.

func (*Writer) SetID

func (s *Writer) SetID(id v3.ID) error

SetID stores the databases schema version and build time.

Jump to

Keyboard shortcuts

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