@@ -11,6 +11,7 @@ const (
11
11
CodeBuildPhaseChangeDetailType = "CodeBuild Build Phase Change"
12
12
)
13
13
14
+ // CodeBuildPhaseStatus represents the status of code build phase (i.e. failed, in progress)
14
15
type CodeBuildPhaseStatus string
15
16
16
17
const (
@@ -23,6 +24,7 @@ const (
23
24
CodeBuildPhaseStatusTimedOut = "TIMED_OUT"
24
25
)
25
26
27
+ // CodeBuildPhaseType represents the type of the code build phase (i.e. submitted, install)
26
28
type CodeBuildPhaseType string
27
29
28
30
const (
@@ -73,6 +75,7 @@ type CodeBuildEvent struct {
73
75
Detail CodeBuildEventDetail `json:"detail"`
74
76
}
75
77
78
+ // CodeBuildEventDetail represents the all details related to the code build event
76
79
type CodeBuildEventDetail struct {
77
80
BuildStatus CodeBuildPhaseStatus `json:"build-status"`
78
81
ProjectName string `json:"project-name"`
@@ -90,6 +93,7 @@ type CodeBuildEventDetail struct {
90
93
CompletedPhaseEnd CodeBuildTime `json:"completed-phase-end"`
91
94
}
92
95
96
+ //CodeBuildEventAdditionalInformation represents additional informations to the code build event
93
97
type CodeBuildEventAdditionalInformation struct {
94
98
Artifact CodeBuildArtifact `json:"artifact"`
95
99
@@ -110,12 +114,14 @@ type CodeBuildEventAdditionalInformation struct {
110
114
Phases []CodeBuildPhase `json:"phases"`
111
115
}
112
116
117
+ // CodeBuildArtifact represents the artifact provided to build
113
118
type CodeBuildArtifact struct {
114
119
MD5Sum string `json:"md5sum"`
115
120
SHA256Sum string `json:"sha256sum"`
116
121
Location string `json:"location"`
117
122
}
118
123
124
+ // CodeBuildEnvironment represents the environment for a build
119
125
type CodeBuildEnvironment struct {
120
126
Image string `json:"image"`
121
127
PrivilegedMode bool `json:"privileged-mode"`
@@ -124,6 +130,7 @@ type CodeBuildEnvironment struct {
124
130
EnvironmentVariables []CodeBuildEnvironmentVariable `json:"environment-variables"`
125
131
}
126
132
133
+ // CodeBuildEnvironmentVariable encapsulate environment variables for the code build
127
134
type CodeBuildEnvironmentVariable struct {
128
135
// Name is the name of the environment variable.
129
136
Name string `json:"name"`
@@ -135,17 +142,20 @@ type CodeBuildEnvironmentVariable struct {
135
142
Value string `json:"value"`
136
143
}
137
144
145
+ // CodeBuildSource represent the code source will be build
138
146
type CodeBuildSource struct {
139
147
Location string `json:"location"`
140
148
Type string `json:"type"`
141
149
}
142
150
151
+ // CodeBuildLogs gives the log details of a code build
143
152
type CodeBuildLogs struct {
144
153
GroupName string `json:"group-name"`
145
154
StreamName string `json:"stream-name"`
146
155
DeepLink string `json:"deep-link"`
147
156
}
148
157
158
+ // CodeBuildPhase represents the phase of a build and its details
149
159
type CodeBuildPhase struct {
150
160
PhaseContext []interface {} `json:"phase-context"`
151
161
@@ -160,14 +170,17 @@ type CodeBuildPhase struct {
160
170
PhaseStatus CodeBuildPhaseStatus `json:"phase-status"`
161
171
}
162
172
173
+ // CodeBuildTime represents the time of the build
163
174
type CodeBuildTime time.Time
164
175
165
176
const codeBuildTimeFormat = "Jan 2, 2006 3:04:05 PM"
166
177
178
+ // MarshalJSON converts a given CodeBuildTime to json
167
179
func (t CodeBuildTime ) MarshalJSON () ([]byte , error ) {
168
180
return json .Marshal (time .Time (t ).Format (codeBuildTimeFormat ))
169
181
}
170
182
183
+ // UnmarshalJSON converts a given json to a CodeBuildTime
171
184
func (t * CodeBuildTime ) UnmarshalJSON (data []byte ) error {
172
185
var s string
173
186
if err := json .Unmarshal (data , & s ); err != nil {
0 commit comments