database

package
v0.0.0-...-9dc8ccb Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// contains filtered or unexported fields
}

func Init

func Init(path string) (result *DB, err error)

Init opens and connects to the database.

func (*DB) AddArtifact

func (db *DB) AddArtifact(uuid, payload string) (err error)

AddArtifact adds a spec to the database.

func (*DB) AddPoint

func (db *DB) AddPoint(input InflectionPoint) (err error)

AddPoint inserts an InflectionPoint entry into the database if it doesn't exist already.

func (*DB) GetAll

func (db *DB) GetAll() (result []InflectionPoint, err error)

func (*DB) GetAllWithSpec

func (db *DB) GetAllWithSpec(abstractSpec string) (result []InflectionPoint, err error)

func (*DB) GetArtifact

func (db *DB) GetArtifact(uuid string) (payload string, err error)

GetArtifact searches for and returns a the corresponding artifact from the database if the artifact exists.

func (*DB) GetPoint

func (db *DB) GetPoint(in InflectionPoint) (result InflectionPoint, err error)

GetPoint searches for and returns a the corresponding entry from the database if the entry exists.

func (*DB) RemoveArtifact

func (db *DB) RemoveArtifact(uuid string) (payload string, err error)

RemoveArtifact deletes and returns an artifact from the database.

func (*DB) RemovePoint

func (db *DB) RemovePoint(in InflectionPoint) (result InflectionPoint, err error)

RemovePoint deletes and returns an entry from the database.

func (*DB) Update

func (db *DB) Update(entry InflectionPoint) (old InflectionPoint, err error)

Update attempts to modify an existing entry in the database.

type InflectionPoint

type InflectionPoint struct {
	// ID is a autoincrement value added for possible visualizations
	ID int64

	// AbstractSpec is the string form of the input spec.
	AbstractSpec string

	// GitCommit is the commit found at which there was an inflection point.
	GitCommit     string
	GitAuthorDate time.Time
	GitCommitDate time.Time

	// Which concretizer was used for the inflection point.
	Concretizer string

	// List of files changed within an inflection point.
	Files []string

	// List of tags associated with the inflection point.
	Tags []string

	// SpecUUID is a UUID to the JSON encoded concrete spec
	SpecUUID string

	// ConcretizationErrUUID is a UUID to the std output of a failed concretization.
	ConcretizationErrUUID string

	// Built and Concretized booleans
	// for quickly filtering inflection points.
	Built       bool
	Concretized bool

	// Primary is a boolean signifying if the inflection was caused directly
	// by this abstract spec
	Primary bool
}

InflectionPoint is the information saved in the database for each inflection point found for an abstract spec within the spack repository.

Jump to

Keyboard shortcuts

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