postgres

package
Version: v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InsertDistScanArtifacts

func InsertDistScanArtifacts(ctx context.Context, pool *pgxpool.Pool, layerHash claircore.Digest, dists []*claircore.Distribution, scnrs indexer.VersionedScanners) error

InsertDistScanArtifacts will create DistributionScanArtifacts linking the layer hash, dist, and scanner artifacts.

If multiple scanners are provided they will be linked in i % n fashion where "i" is the current index of the dists slice and "n" is the length of the scnrs slice.

func InsertDistributions

func InsertDistributions(ctx context.Context, pool *pgxpool.Pool, dists []*claircore.Distribution) error

func InsertPackageScanArtifacts

func InsertPackageScanArtifacts(ctx context.Context, pool *pgxpool.Pool, layerHash claircore.Digest, pkgs []*claircore.Package, scnrs indexer.VersionedScanners) error

InsertPackageScanArtifacts will create ScanArtifacts linking the layer hash, packages, and scanner artifacts.

If multiple scanners are provided they will be linked in i % n fashion where "i" is the current index of the Packages array and "n" is the length of the scanners array.

func InsertPackages

func InsertPackages(ctx context.Context, pool *pgxpool.Pool, pkgs []*claircore.Package) error

InsertUniquePackages inserts each unique package into the database. Nested distribution and source packages are un nested and inserted. The pkgs array should be created by a call to GenUniquePackages

func InsertRepoScanArtifact

func InsertRepoScanArtifact(ctx context.Context, pool *pgxpool.Pool, layerHash claircore.Digest, repos []*claircore.Repository, scnrs indexer.VersionedScanners) error

func InsertRepositories

func InsertRepositories(ctx context.Context, pool *pgxpool.Pool, repos []*claircore.Repository) error

func InsertScannerList

func InsertScannerList(ctx context.Context, pool *pgxpool.Pool, hash claircore.Digest, n int) error

InsertScannerList is to be used with `test.GenUniqueScanners()`. Inserts a ScannerList record for scanner IDs 0...n associated with provided manifest hash

func InsertUniqueScanners

func InsertUniqueScanners(ctx context.Context, pool *pgxpool.Pool, scnrs indexer.VersionedScanners) error

InsertUniqueScanners inserts each unique scanner into the database. the scanner's primary key (int) is set to the index of the scanner in the array.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL