-
Notifications
You must be signed in to change notification settings - Fork 30
/
state.go
36 lines (28 loc) · 882 Bytes
/
state.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
package dependency
// State provides a consistent set of values for
// DependencyManager implementations to use to report their state, and
// provide Queues and Jobs with a common set of terms to describe the
// state of a job's dependencies
type State int
//go:generate stringer -type=State
const (
// Ready indicates that a job is safe to execute from the
// perspective of the Dependency Manager.
Ready State = iota
// Passed indicates that there is no work to be done for this
// dependency.
Passed
// Blocked job are waiting for their dependencies to be
// resolved.
Blocked
// Unresolved states are for cyclic dependencies or cases
// where jobs depend on resources that cannot be built.
Unresolved
)
// IsValidState checks states and ensures that a state is valid.
func IsValidState(s State) bool {
if s >= 0 && s <= 3 {
return true
}
return false
}