# Packages
Package pgsql implements database.Datastore with PostgreSQL.
# Functions
AcquireLock acquires a named global lock for a duration.
AssertAncestryEqual asserts actual ancestry equals to expected ancestry content wise.
AssertAncestryLayerEqual asserts actual ancestry layer equals to expected ancestry layer content wise.
AssertDetectorsEqual asserts actual detectors are content wise equal to expected detectors regardless of the ordering.
AssertElementsEqual asserts that content in actual equals to content in expected array regardless of ordering.
AssertFeaturesEqual asserts content in actual equals content in expected regardless of ordering.
AssertIntStringMapEqual asserts two maps with integer as key and string as value are equal.
AssertLayerEqual asserts actual layer equals to expected layer content wise.
AssertLayerFeaturesEqual asserts content in actual equals to content in expected regardless of ordering.
AssertLayerNamespacesEqual asserts content in actual equals to content in expected regardless of ordering.
AssertMetadataMapEqual asserts two metadata maps are equal.
AssertNamespacesEqual asserts content in actual equals to content in expected regardless of ordering.
AssertVulnerabilityEqual asserts two vulnerabilities are equal.
CacheRelatedVulnerabilityAndCommit wraps session CacheAffectedNamespacedFeatures function with begin and commit.
ConvertFeatureSetToFeatures converts a feature set to an array of features.
No description provided by the author
DeduplicateFeatures deduplicates a list of list of features.
DeduplicateNamespacedFeatures returns a copy of all unique features in the input.
DeduplicateNamespaces deduplicates a list of namespaces.
DiffDetectors returns the detectors belongs to d1 but not d2.
ExtendLock extends the duration of an existing global lock for the given duration.
FindAffectedNamespacedFeaturesAndRollback finds the vulnerabilities on each feature.
FindAncestryAndRollback wraps session FindAncestry function with begin and rollback.
FindKeyValueAndRollback wraps session FindKeyValue function with begin and roll back.
FindLayerAndRollback wraps session FindLayer function with begin and rollback.
FindNewNotification finds notifications either never notified or notified before the given time.
FindVulnerabilitiesAndRollback finds the vulnerabilities based on given ids.
FindVulnerabilityNotificationAndRollback finds the vulnerability notification and rollback.
GetAncestryFeatures returns a list of unique namespaced features in the ancestry.
InsertVulnerabilityNotificationsAndCommit inserts the notifications into db and commit.
IntersectDetectors returns the detectors in both d1 and d2.
MarkNotificationAsReadAndCommit marks a notification as read.
MergeLayers merges all content in new layer to l, where the content is updated.
No description provided by the author
NewDetectorType attempts to parse a string into a standard DetectorType value.
No description provided by the author
NewFeatureDetector returns a new feature detector.
No description provided by the author
NewNamespaceDetector returns a new namespace detector.
No description provided by the author
NewSeverity attempts to parse a string into a standard Severity value.
No description provided by the author
NewStorageError creates a new database error.
NewStorageErrorWithInternalError creates a new database error.
Open opens a Datastore specified by a configuration.
PersistDetectorsAndCommit stores the detectors in the data store.
PersistFeaturesAndCommit wraps session PersistFeaturesAndCommit function with begin and commit.
PersistNamespacedFeaturesAndCommit wraps session PersistNamespacedFeatures function with begin and commit.
PersistNamespacesAndCommit wraps session PersistNamespaces function with begin and commit.
PersistPartialLayerAndCommit wraps session PersistLayer function with begin and commit.
Register makes a Constructor available by the provided name.
ReleaseLock releases a named global lock.
SerializeDetectors returns the string representation of given detectors.
UpdateKeyValueAndCommit stores the key value to storage.
No description provided by the author
UpsertAncestryAndCommit wraps session UpsertAncestry function with begin and commit.
# Constants
No description provided by the author
CriticalSeverity is a world-burning problem, exploitable for nearly all people in a default installation of Linux.
Defcon1Severity is a Critical problem which has been manually highlighted by the team.
FeatureDetectorType is a type of detector that extracts the features.
HighSeverity is a real problem, exploitable for many people in a default installation.
LowSeverity is a security problem, but is hard to exploit due to environment, requires a user-assisted attack, a small install base, or does very little damage.
MediumSeverity is a real security problem, and is exploitable for many people.
NamespaceDetectorType is a type of detector that extracts the namespaces.
NegligibleSeverity is technically a security problem, but is only theoretical in nature, requires a very special situation, has almost no install base, or does no real damage.
No description provided by the author
UnknownSeverity is either a security problem that has not been assigned to a priority yet or a priority that our system did not recognize.
# Variables
DebianReleasesMapping translates Debian code names and class names to version numbers.
DetectorTypes contains all detector types.
ErrBackendException is an error that occurs when the database backend does not work properly (ie.
ErrFailedToParseDetectorType is the error returned when a detector type could not be parsed from a string.
ErrFailedToParseSeverity is the error returned when a severity could not be parsed from a string.
ErrInconsistent is an error that occurs when a database consistency check fails (i.e.
ErrInvalidDetector is the error returned when a detector from database has invalid name or version or type.
ErrInvalidParameters is an error that occurs when the parameters are not valid.
ErrMissingEntities is an error that occurs when an associated immutable entity doesn't exist in the database.
Severities lists all known severities, ordered from lowest to highest.
UbuntuReleasesMapping translates Ubuntu code names to version numbers.
# Structs
AffectedFeature is used to determine whether a namespaced feature is affected by a Vulnerability.
AffectedNamespacedFeature is a namespaced feature affected by the vulnerabilities with fixed-in versions for this feature.
Ancestry is a manifest that keeps all layers in an image in order.
AncestryFeature is a namespaced feature with the detectors used to find this feature.
AncestryLayer is a layer with all detected namespaced features.
Detector is an versioned Clair extension.
Feature represents a package detected in a layer but the namespace is not determined.
Layer is a layer with all the detected features and namespaces.
LayerFeature is a feature with detection information.
LayerNamespace is a namespace with detection information.
MockDatastore implements Datastore and enables overriding each available method.
MockSession implements Session and enables overriding each available method.
Namespace is the contextual information around features.
NamespacedFeature is a feature with determined namespace and can be affected by vulnerabilities.
NotificationHook is a message sent to another service to inform of a change to a Vulnerability or the Ancestries affected by a Vulnerability.
NullableAffectedNamespacedFeature is an affectednamespacedfeature with whether it's found in datastore.
NullableVulnerability is a vulnerability with whether the vulnerability is found in datastore.
PagedVulnerableAncestries is a vulnerability with a page of affected ancestries each with a special index attached for streaming purpose.
RegistrableComponentConfig is a configuration block that can be used to determine which registrable component should be initialized and pass custom configuration to it.
StorageError is database error.
Vulnerability represents CVE or similar vulnerability reports.
VulnerabilityID is an identifier for every vulnerability.
VulnerabilityNotification is a notification for vulnerability changes.
VulnerabilityNotificationWithVulnerable is a notification for vulnerability changes with vulnerable ancestries.
VulnerabilityWithAffected is a vulnerability with all known affected features.
VulnerabilityWithFixedIn is used for AffectedNamespacedFeature to retrieve the affecting vulnerabilities and the fixed-in versions for the feature.
# Type aliases
DetectorType is the type of a detector.
Driver is a function that opens a Datastore specified by its database driver type and specific configuration.
FeatureType indicates the type of feature that a vulnerability affects.
MetadataMap is for storing the metadata returned by vulnerability database.
Severity defines a standard scale for measuring the severity of a vulnerability.