forked from concourse/concourse
/
input_mapping.go
54 lines (41 loc) · 1.08 KB
/
input_mapping.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package db
import (
"fmt"
"github.com/pf-qiu/concourse/v6/atc"
)
type ResolutionFailure string
const (
LatestVersionNotFound ResolutionFailure = "latest version of resource not found"
VersionNotFound ResolutionFailure = "version of resource not found"
NoSatisfiableBuilds ResolutionFailure = "no satisfiable builds from passed jobs found for set of inputs"
)
type PinnedVersionNotFound struct {
PinnedVersion atc.Version
}
func (p PinnedVersionNotFound) String() ResolutionFailure {
var text string
for k, v := range p.PinnedVersion {
text += fmt.Sprintf(" %s:%s", k, v)
}
return ResolutionFailure(fmt.Sprintf("pinned version%s not found", text))
}
type JobSet map[int]bool
type InputMapping map[string]InputResult
type InputResult struct {
Input *AlgorithmInput
PassedBuildIDs []int
ResolveError ResolutionFailure
}
type ResourceVersion string
type AlgorithmVersion struct {
ResourceID int
Version ResourceVersion
}
type AlgorithmInput struct {
AlgorithmVersion
FirstOccurrence bool
}
type AlgorithmOutput struct {
AlgorithmVersion
InputName string
}