/
always.go
38 lines (34 loc) · 1.01 KB
/
always.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
/*
Package dependency contains the Manager interface, along with several
implementations for different kinds of dependency checks.
*/
package dependency
// Always is a DependencyManager implementation that always reports
// that the task is ready to run.
type Always struct {
ShouldRebuild bool `json:"should_rebuild" bson:"should_rebuild" yaml:"should_rebuild"`
T TypeInfo `json:"type" bson:"type" yaml:"type"`
JobEdges
}
// NewAlways creates a DependencyManager object that always
// returns the "Ready" indicating that all dependency requirements
// are met and that the target is required.
func NewAlways() *Always {
return &Always{
ShouldRebuild: true,
JobEdges: *NewJobEdges(),
T: TypeInfo{
Name: AlwaysRun,
Version: 0,
},
}
}
// State always returns, for Always, the "Ready" state.
func (d *Always) State() State {
return Ready
}
// Type returns a DependencyInterchange object to assist in
// unmarshalling dependency objects.
func (d *Always) Type() TypeInfo {
return d.T
}