target

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package target provides storage backends for vulnerability data.

Targets are selected by URI scheme:

  • sqlite://path/to/db.db - SQLite database (default, supports query)
  • postgres://host:port/db - PostgreSQL database (supports query)
  • bq://project.dataset.table - Google BigQuery (import only)
  • file://path/to/output.json - JSON file output
  • console:// - stdout output

Import targets store vulnerabilities:

importer, _ := target.GetImporter("sqlite://vulns.db")
err := importer(ctx, uri, vulnerabilities)

Query targets support data retrieval:

querier, _ := target.GetQuerier("sqlite://vulns.db")
result, err := querier(ctx, &query.Options{Image: "redis"})

Database schema uses a 6-part primary key for deduplication: (image, digest, source, exposure, package, version)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSampleTargets added in v0.5.0

func GetSampleTargets() []string

Types

type Importer

type Importer func(ctx context.Context, uri string, vuls []*data.ImageVulnerability) error

Importer is the interface for importers.

func GetImporter

func GetImporter(uri string) (Importer, error)

GetImporter returns importer for the given target.

type Querier added in v0.5.0

type Querier func(ctx context.Context, opt *query.Options) (any, error)

Querier is the interface for queriers.

func GetQuerier added in v0.5.0

func GetQuerier(uri string) (Querier, error)

GetQuerier returns querier for the given target.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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