package
0.0.0-20191124171353-69b70c2aef04
Repository: https://github.com/swinslow/peridot-db.git
Documentation: pkg.go.dev

# Functions

ClearDB drops the peridot schema.
HealthFromInt converts an integer to its corresponding Health value.
HealthFromString converts a string to its corresponding Health value.
InitNewDB creates all the peridot database tables.
IntFromHealth converts a Health value to its corresponding integer value.
IntFromJobConfigType converts a JobConfigType value to its corresponding integer value.
IntFromSPDXElementType converts a SPDXElementType value to its corresponding integer value.
IntFromStatus converts a Status value to its corresponding integer value.
IntFromUserAccessLevel converts a UserAccessLevel value to its corresponding integer value.
JobConfigTypeFromInt converts an integer to its corresponding JobConfigType value.
NewDB opens and returns an initialized DB object.
SPDXElementTypeFromInt converts an integer to its corresponding SPDXElementType value.
SPDXElementTypeFromString converts a string to its corresponding SPDXElementType value.
StatusFromInt converts an integer to its corresponding Status value.
StatusFromString converts a string to its corresponding Status value.
StringFromHealth converts a Health value to its corresponding string value.
StringFromSPDXElementType converts a SPDXElementType value to its corresponding string value.
StringFromStatus converts a Status value to its corresponding string value.
StringFromUserAccessLevel converts a UserAccessLevel value to its corresponding string value.
UserAccessLevelFromInt converts an integer to its corresponding UserAccessLevel value.
UserAccessLevelFromString converts a string to its corresponding UserAccessLevel value.

# Constants

AccessAdmin means the user has full control.
AccessCommenter means the user has read-only access, and can additionally add comments for various fields.
AccessDisabled means the user cannot log in or use the platform in any way.
AccessOperator means the user has read-write access for starting new repo pulls, running scans, clearing scan results, etc.
AccessViewer means the user essentially has read-only access: they can view scan results, analyses, reports, etc., but cannot comment, add or edit data.
HealthDegraded means that the operation has encountered some sort of issue that may resulted in degraded performance or quality, but that the operation is currently expected to continue.
HealthError means that the operation has encountered an error that is unrecoverable and that the operation should be treated as failed, and will not proceed further.
HealthOK means that the operation has not yet encountered any problems.
HealthSame is a default zero value, and can mean the operation has the same Health value as some previous point.
JobConfigCodeReader means this JobConfig entry is for a codereader value.
JobConfigKV means this JobConfig entry is key-value.
JobConfigSpdxReader means this JobConfig entry is for an spdxreader value.
SPDXElementTypeComponent refers to an SPDX Package, representing a Component registered in peridot.
SPDXElementTypeFile refers to an SPDX File, representing a FileInstance registered in peridot (and typically contained within the corresponding RepoPull).
SPDXElementTypeRepoPull refers to an SPDX Package, representing the codebase embodied by a RepoPull.
SPDXElementTypeUnknown is a zero value which indicates that the element type is not currently known.
StatusRunning means that the operation has fully begun and is still in process.
StatusSame is a default zero value, and can mean the operation has the same status value as some previous point.
StatusStartup means that the operation is still in a pre-running phase, and is being set up and/or has not yet fully begun.
StatusStopped means that the operation has stopped, regardless of whether it has completed successfully or has encountered an error.

# Structs

Agent describes a separately-running service that is registered with peridot for running Jobs.
DB holds the actual database/sql object as well as its related database statements.
FileHash describes a global object of a file that has been seen by peridot, and that is (or at some point has been) recorded on disk for analysis.
FileInstance describes a particular instance of a file that is in a RepoPull.
Job describes a Job that has been run or is yet to run on an Agent.
JobConfig contains the three available types of configurations variables for a job.
JobPathConfig describes a single configuration field for a Job that has been run or is yet to run.
Project describes a project within peridot.
Repo describes a repo within peridot.
RepoBranch describes a branch of a repo within peridot.
RepoPull describes a pull of code from a branch of a repo within peridot.
Subproject describes a subproject within peridot.
User describes a registered user of the platform.

# Interfaces

Datastore defines the interface to be implemented by models for database tables, using either a backing database (production) or mocks (test).

# Type aliases

Health defines the different health values that can apply to an operation.
JobConfigType defines whether the JobConfig is a key-value config, or a codereader or spdxreader input.
SPDXElementType defines the different types of data to which an SPDXElement in peridot might refer.
Status defines the different status values that can apply to an operation.
UserAccessLevel defines the different tiers of access that a User can have.