Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNotExist = errors.New("does not exist")
ErrNotExist indicates that a record does not exist
Functions ¶
This section is empty.
Types ¶
type Application ¶
Application stores the name of the Application
func (*Application) NameLower ¶
func (a *Application) NameLower() string
NameLower returns the app of the name in lowercase
type ArtifactType ¶ added in v0.11.1
type ArtifactType string
ArtifactType describes the type of an artifact
const ( //DockerArtifact is a docker image artifact DockerArtifact ArtifactType = "docker" //FileArtifact is a file artifact FileArtifact ArtifactType = "file" )
type Build ¶
type Build struct { ID int Application Application VCSState VCSState StartTimeStamp time.Time StopTimeStamp time.Time TotalInputDigest string Outputs []*Output Inputs []*Input }
Build represents a stored build
type BuildWithDuration ¶ added in v0.9.0
BuildWithDuration adds duration to a Build
type Field ¶ added in v0.9.0
type Field int
Field represents data fields that can be used in sort and filter operations
type Issue ¶
type Issue string
Issue describes an issue in the build database
const ( // IssueOutputDigestMissing describes that a build didn't produces an // output that other builds with the same input digest produced IssueOutputDigestMissing Issue = "output with digest missing" // IssueUnmatchedDigest describes that a build produced an output with // a different digest then other builds with the same inputs IssueUnmatchedDigest Issue = "output with different digest" )
type Op ¶ added in v0.9.0
type Op int
Op describes the filter operator
const ( // OpEQ represents an equal (=) operator OpEQ Op = iota // OpGT represents a greater than (>) operator OpGT // OpLT represents a smaller than (<) operator OpLT // OpIN represents a In operator, works like the SQL IN operator, the // corresponding Value field in The filter struct must be a slice OpIN )
type Order ¶ added in v0.9.0
type Order int
Order specifies the sort order
func OrderFromStr ¶ added in v0.9.0
OrderFromStr converts a string to an Order
type Output ¶
type Output struct { Name string Type ArtifactType Digest string SizeBytes int64 Upload Upload }
Output represents a build output
type Storer ¶
type Storer interface { Init() error Save(b *Build) error GetApps() ([]*Application, error) GetSameTotalInputDigestsForAppBuilds(appName string, startTs time.Time) (map[string][]int, error) GetLatestBuildByDigest(appName, totalInputDigest string) (*BuildWithDuration, error) GetBuildOutputs(buildID int) ([]*Output, error) BuildExist(id int) (bool, error) // GetBuildWithoutInputsOutputs returns a single build, if no build with the ID // exist ErrNotExist is returned GetBuildWithoutInputsOutputs(id int) (*BuildWithDuration, error) GetBuildsWithoutInputsOutputs(filters []*Filter, sorters []*Sorter) ([]*BuildWithDuration, error) }
Storer is an interface for persisting informations about builds
type Upload ¶
type Upload struct { ID int UploadDuration time.Duration URI string Method UploadMethod }
Upload contains informations about an output upload
type UploadMethod ¶ added in v0.11.1
type UploadMethod string
UploadMethod describes the used upload mechanism
const ( S3 UploadMethod = "s3" DockerRegistry UploadMethod = "docker" FileCopy UploadMethod = "filecopy" )
Description of UploadMethod Values
type VerifyIssue ¶
type VerifyIssue struct { Build *BuildWithDuration Output *Output ReferenceBuild *BuildWithDuration Issue Issue }
VerifyIssue describes a found issue during verification
func VerifySameInputDigestSameOutputs ¶
func VerifySameInputDigestSameOutputs(clt Storer, appName string, startTs time.Time) ([]*VerifyIssue, error)
VerifySameInputDigestSameOutputs if the application has multiple builds with the same total input digest, it finds the most common outputs by digest from those builds and checks if the other builds have the outputs with the same digest. For builds that don't match an Issue description is returned