-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild_exchange.go
36 lines (30 loc) · 987 Bytes
/
build_exchange.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 cicd
const (
// TaskTest is a command to test application
TaskTest = "test"
// TaskDeploy is a command to release applicaiton
TaskDeploy = "deploy"
)
// Error is a common error typical for all responses
type Error struct {
Code int `json:"code"`
Message string `json:"message"`
}
// BuildRequest defines request body of Build API method
type BuildRequest struct {
Username string `json:"username"`
Repository string `json:"repository"`
CommitHash string `json:"commitHash"`
Task string `json:"task"`
Version *string `json:"version"` // Version is actual only for TaskDeploy
}
// BuildResponse defines response body of Build API method
type BuildResponse struct {
Error *Error `json:"error,omitempty"`
Data *Build `json:"data,omitempty"`
}
// Build defines data for response body of Build API method
// It contains RequestID parameter to be able to deal with logs of CICD service
type Build struct {
RequestID string `json:"requestID"`
}