forked from concourse/concourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
92 lines (76 loc) · 1.8 KB
/
types.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
package runtime
import (
"context"
"fmt"
"io"
"code.cloudfoundry.org/lager"
"github.com/pf-qiu/concourse/v6/atc"
)
const (
ResourceResultPropertyName = "concourse:resource-result"
ResourceProcessID = "resource"
)
//go:generate counterfeiter . StartingEventDelegate
type StartingEventDelegate interface {
Starting(lager.Logger)
SelectedWorker(lager.Logger, string)
}
type VersionResult struct {
Version atc.Version `json:"version"`
Metadata []atc.MetadataField `json:"metadata,omitempty"`
}
type PutRequest struct {
Source atc.Source `json:"source"`
Params atc.Params `json:"params,omitempty"`
}
type GetRequest struct {
Source atc.Source `json:"source"`
Params atc.Params `json:"params,omitempty"`
}
//go:generate counterfeiter . Artifact
type Artifact interface {
ID() string
}
type CacheArtifact struct {
TeamID int
JobID int
StepName string
Path string
}
func (art CacheArtifact) ID() string {
return fmt.Sprintf("%d, %d, %s, %s", art.TeamID, art.JobID, art.StepName, art.Path)
}
// TODO (Krishna/Sameer): get rid of these - can GetArtifact and TaskArtifact be merged ?
type GetArtifact struct {
VolumeHandle string
}
func (art GetArtifact) ID() string {
return art.VolumeHandle
}
type TaskArtifact struct {
VolumeHandle string
}
func (art TaskArtifact) ID() string {
return art.VolumeHandle
}
// TODO (runtime/#4910): consider a different name as this is close to "Runnable" in atc/engine/engine
//go:generate counterfeiter . Runner
type Runner interface {
RunScript(
ctx context.Context,
path string,
args []string,
input []byte,
output interface{},
logDest io.Writer,
recoverable bool,
) error
}
type ProcessSpec struct {
Path string
Args []string
Dir string
User string
StdoutWriter io.Writer
StderrWriter io.Writer
}