github.com/chenbh/concourse/v6@v6.4.2/atc/event/deprecated_events.go (about) 1 package event 2 3 import "github.com/chenbh/concourse/v6/atc" 4 5 // move events here as they cease to be emitted by new code. 6 // 7 // denormalize the any external consts (e.g. type) so these are self-contained. 8 9 type InputV10 struct { 10 Input LegacyTurbineInput `json:"input"` 11 } 12 13 type LegacyTurbineInput struct { 14 Name string `json:"name"` 15 Resource string `json:"resource"` 16 Type string `json:"type"` 17 Version map[string]interface{} `json:"version,omitempty"` 18 Metadata []struct { 19 Name string `json:"name"` 20 Value string `json:"value"` 21 } `json:"metadata,omitempty"` 22 ConfigPath string `json:"config_path"` 23 } 24 25 func (InputV10) EventType() atc.EventType { return "input" } 26 func (InputV10) Version() atc.EventVersion { return "1.0" } 27 28 type OutputV10 struct { 29 Output LegacyTurbineOutput `json:"output"` 30 } 31 32 type LegacyTurbineOutput struct { 33 Name string `json:"name"` 34 Type string `json:"type"` 35 On []string `json:"on,omitempty"` 36 Version map[string]interface{} `json:"version,omitempty"` 37 Metadata []struct { 38 Name string `json:"name"` 39 Value string `json:"value"` 40 } `json:"metadata,omitempty"` 41 } 42 43 func (OutputV10) EventType() atc.EventType { return "output" } 44 func (OutputV10) Version() atc.EventVersion { return "1.0" } 45 46 type LogV10 struct { 47 Origin OriginV10 `json:"origin"` 48 Payload string `json:"payload"` 49 } 50 51 func (LogV10) EventType() atc.EventType { return "log" } 52 func (LogV10) Version() atc.EventVersion { return "1.0" } 53 54 type LogV20 struct { 55 Origin OriginV20 `json:"origin"` 56 Payload string `json:"payload"` 57 } 58 59 func (LogV20) EventType() atc.EventType { return "log" } 60 func (LogV20) Version() atc.EventVersion { return "2.0" } 61 62 type LogV30 struct { 63 Origin OriginV30 `json:"origin"` 64 Payload string `json:"payload"` 65 } 66 67 func (LogV30) EventType() atc.EventType { return "log" } 68 func (LogV30) Version() atc.EventVersion { return "3.0" } 69 70 type OriginV10 struct { 71 Type OriginV10Type `json:"type"` 72 Name string `json:"name"` 73 } 74 75 type OriginV10Type string 76 77 const ( 78 OriginV10TypeInvalid OriginV10Type = "" 79 OriginV10TypeInput OriginV10Type = "input" 80 OriginV10TypeOutput OriginV10Type = "output" 81 OriginV10TypeRun OriginV10Type = "run" 82 ) 83 84 type OriginV20 struct { 85 Name string `json:"name"` 86 Type OriginV20Type `json:"type"` 87 Source OriginV20Source `json:"source"` 88 Location OriginV20Location `json:"location,omitempty"` 89 Substep bool `json:"substep"` 90 Hook string `json:"hook"` 91 } 92 93 type OriginV20Type string 94 95 const ( 96 OriginV20TypeInvalid OriginV20Type = "" 97 OriginV20TypeGet OriginV20Type = "get" 98 OriginV20TypePut OriginV20Type = "put" 99 OriginV20TypeTask OriginV20Type = "task" 100 ) 101 102 type OriginV20Source string 103 104 const ( 105 OriginV20SourceStdout OriginV20Source = "stdout" 106 OriginV20SourceStderr OriginV20Source = "stderr" 107 ) 108 109 type OriginV20LocationIncrement uint 110 111 const ( 112 NoIncrementV10 OriginV20LocationIncrement = 0 113 SingleIncrementV10 OriginV20LocationIncrement = 1 114 ) 115 116 type OriginV20Location []uint 117 118 type OriginV30 struct { 119 Name string `json:"name"` 120 Type OriginV30Type `json:"type"` 121 Source OriginV30Source `json:"source"` 122 Location OriginV30Location `json:"location,omitempty"` 123 Hook string `json:"hook"` 124 } 125 126 type OriginV30Type string 127 128 const ( 129 OriginV30TypeInvalid OriginV30Type = "" 130 OriginV30TypeGet OriginV30Type = "get" 131 OriginV30TypePut OriginV30Type = "put" 132 OriginV30TypeTask OriginV30Type = "task" 133 ) 134 135 type OriginV30Source string 136 137 const ( 138 OriginV30SourceStdout OriginV30Source = "stdout" 139 OriginV30SourceStderr OriginV30Source = "stderr" 140 ) 141 142 type OriginV30Location struct { 143 ParentID uint `json:"parent_id"` 144 ID uint `json:"id"` 145 ParallelGroup uint `json:"parallel_group"` 146 SerialGroup uint `json:"serial_group"` 147 Hook string `json:"hook"` 148 } 149 150 type OriginV30LocationIncrement uint 151 152 const ( 153 NoIncrementV20 OriginV30LocationIncrement = 0 154 SingleIncrementV20 OriginV30LocationIncrement = 1 155 ) 156 157 type FinishV10 struct { 158 Time int64 `json:"time"` 159 ExitStatus int `json:"exit_status"` 160 } 161 162 func (FinishV10) EventType() atc.EventType { return "finish" } 163 func (FinishV10) Version() atc.EventVersion { return "1.0" } 164 165 type FinishTaskV10 struct { 166 Time int64 `json:"time"` 167 ExitStatus int `json:"exit_status"` 168 Origin OriginV20 `json:"origin"` 169 } 170 171 func (FinishTaskV10) EventType() atc.EventType { return "finish-task" } 172 func (FinishTaskV10) Version() atc.EventVersion { return "1.0" } 173 174 type FinishTaskV20 struct { 175 Time int64 `json:"time"` 176 ExitStatus int `json:"exit_status"` 177 Origin OriginV30 `json:"origin"` 178 } 179 180 func (FinishTaskV20) EventType() atc.EventType { return "finish-task" } 181 func (FinishTaskV20) Version() atc.EventVersion { return "2.0" } 182 183 type StartV10 struct { 184 Time int64 `json:"time"` 185 } 186 187 type FinishGetV10 struct { 188 Origin OriginV20 `json:"origin"` 189 Plan GetPlanV40 `json:"plan"` 190 ExitStatus int `json:"exit_status"` 191 FetchedVersion atc.Version `json:"version"` 192 FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"` 193 } 194 195 func (FinishGetV10) EventType() atc.EventType { return "finish-get" } 196 func (FinishGetV10) Version() atc.EventVersion { return "1.0" } 197 198 type FinishGetV20 struct { 199 Origin OriginV30 `json:"origin"` 200 Plan GetPlanV40 `json:"plan"` 201 ExitStatus int `json:"exit_status"` 202 FetchedVersion atc.Version `json:"version"` 203 FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"` 204 } 205 206 func (FinishGetV20) EventType() atc.EventType { return "finish-get" } 207 func (FinishGetV20) Version() atc.EventVersion { return "2.0" } 208 209 type FinishPutV10 struct { 210 Origin OriginV20 `json:"origin"` 211 Plan PutPlanV40 `json:"plan"` 212 CreatedVersion atc.Version `json:"version"` 213 CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"` 214 ExitStatus int `json:"exit_status"` 215 } 216 217 func (FinishPutV10) EventType() atc.EventType { return "finish-put" } 218 func (FinishPutV10) Version() atc.EventVersion { return "1.0" } 219 220 type FinishPutV20 struct { 221 Origin OriginV30 `json:"origin"` 222 Plan PutPlanV40 `json:"plan"` 223 CreatedVersion atc.Version `json:"version"` 224 CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"` 225 ExitStatus int `json:"exit_status"` 226 } 227 228 func (FinishPutV20) EventType() atc.EventType { return "finish-put" } 229 func (FinishPutV20) Version() atc.EventVersion { return "2.0" } 230 231 func (StartV10) EventType() atc.EventType { return "start" } 232 func (StartV10) Version() atc.EventVersion { return "1.0" } 233 234 type StartTaskV10 struct { 235 Time int64 `json:"time"` 236 Origin OriginV20 `json:"origin"` 237 } 238 239 func (StartTaskV10) EventType() atc.EventType { return "start-task" } 240 func (StartTaskV10) Version() atc.EventVersion { return "1.0" } 241 242 type StartTaskV20 struct { 243 Time int64 `json:"time"` 244 Origin OriginV30 `json:"origin"` 245 } 246 247 func (StartTaskV20) EventType() atc.EventType { return "start-task" } 248 func (StartTaskV20) Version() atc.EventVersion { return "2.0" } 249 250 type InitializeV10 struct { 251 TaskConfig TaskConfig `json:"config"` 252 } 253 254 func (InitializeV10) EventType() atc.EventType { return "initialize" } 255 func (InitializeV10) Version() atc.EventVersion { return "1.0" } 256 257 type InitializeTaskV10 struct { 258 TaskConfig TaskConfig `json:"config"` 259 Origin OriginV20 `json:"origin"` 260 } 261 262 func (InitializeTaskV10) EventType() atc.EventType { return "initialize-task" } 263 func (InitializeTaskV10) Version() atc.EventVersion { return "1.0" } 264 265 type InitializeTaskV20 struct { 266 TaskConfig TaskConfig `json:"config"` 267 Origin OriginV30 `json:"origin"` 268 } 269 270 func (InitializeTaskV20) EventType() atc.EventType { return "initialize-task" } 271 func (InitializeTaskV20) Version() atc.EventVersion { return "2.0" } 272 273 type InputV20 struct { 274 Plan InputV20InputPlan `json:"plan"` 275 FetchedVersion atc.Version `json:"version"` 276 FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"` 277 } 278 279 func (InputV20) EventType() atc.EventType { return "input" } 280 func (InputV20) Version() atc.EventVersion { return "2.0" } 281 282 type OutputV20 struct { 283 Plan OutputV20OutputPlan `json:"plan"` 284 CreatedVersion atc.Version `json:"version"` 285 CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"` 286 } 287 288 func (OutputV20) EventType() atc.EventType { return "output" } 289 func (OutputV20) Version() atc.EventVersion { return "2.0" } 290 291 type InputV20InputPlan struct { 292 // logical name of the input with respect to the task's config 293 Name string `json:"name"` 294 295 // name of resource providing the input 296 Resource string `json:"resource"` 297 298 // type of resource 299 Type string `json:"type"` 300 301 // e.g. sha 302 Version atc.Version `json:"version,omitempty"` 303 } 304 305 type OutputV20OutputPlan struct { 306 Name string `json:"name"` 307 308 Type string `json:"type"` 309 310 // e.g. [success, failure] 311 On []string `json:"on,omitempty"` 312 } 313 314 type ErrorV10 struct { 315 Message string `json:"message"` 316 Origin OriginV20 `json:"origin,omitempty"` 317 } 318 319 func (ErrorV10) EventType() atc.EventType { return "error" } 320 func (ErrorV10) Version() atc.EventVersion { return "1.0" } 321 322 type ErrorV20 struct { 323 Message string `json:"message"` 324 Origin OriginV30 `json:"origin,omitempty"` 325 } 326 327 func (ErrorV20) EventType() atc.EventType { return "error" } 328 func (ErrorV20) Version() atc.EventVersion { return "2.0" } 329 330 // [Tracker: #97774988] Location -> PlanID changed Origin, which changes a bunch of stuff 331 332 type ErrorV30 struct { 333 Message string `json:"message"` 334 Origin OriginV40 `json:"origin,omitempty"` 335 } 336 337 func (ErrorV30) EventType() atc.EventType { return "error" } 338 func (ErrorV30) Version() atc.EventVersion { return "3.0" } 339 340 type FinishTaskV30 struct { 341 Time int64 `json:"time"` 342 ExitStatus int `json:"exit_status"` 343 Origin OriginV40 `json:"origin"` 344 } 345 346 func (FinishTaskV30) EventType() atc.EventType { return "finish-task" } 347 func (FinishTaskV30) Version() atc.EventVersion { return "3.0" } 348 349 type InitializeTaskV30 struct { 350 TaskConfig TaskConfig `json:"config"` 351 Origin OriginV40 `json:"origin"` 352 } 353 354 func (InitializeTaskV30) EventType() atc.EventType { return "initialize-task" } 355 func (InitializeTaskV30) Version() atc.EventVersion { return "3.0" } 356 357 type StartTaskV30 struct { 358 Time int64 `json:"time"` 359 Origin OriginV40 `json:"origin"` 360 } 361 362 func (StartTaskV30) EventType() atc.EventType { return "start-task" } 363 func (StartTaskV30) Version() atc.EventVersion { return "3.0" } 364 365 type LogV40 struct { 366 Origin OriginV40 `json:"origin"` 367 Payload string `json:"payload"` 368 } 369 370 func (LogV40) EventType() atc.EventType { return "log" } 371 func (LogV40) Version() atc.EventVersion { return "4.0" } 372 373 type OriginV40 struct { 374 Name string `json:"name"` 375 Type OriginV40Type `json:"type"` 376 Source OriginSource `json:"source"` 377 Location OriginV40Location `json:"location,omitempty"` 378 } 379 380 type OriginV40Type string 381 382 const ( 383 OriginV40TypeInvalid OriginV40Type = "" 384 OriginV40TypeGet OriginV40Type = "get" 385 OriginV40TypePut OriginV40Type = "put" 386 OriginV40TypeTask OriginV40Type = "task" 387 ) 388 389 type OriginV40Location struct { 390 ParentID uint `json:"parent_id"` 391 ID uint `json:"id"` 392 ParallelGroup uint `json:"parallel_group"` 393 SerialGroup uint `json:"serial_group"` 394 Hook string `json:"hook"` 395 } 396 397 func (ol OriginV40Location) Incr(by OriginV40LocationIncrement) OriginV40Location { 398 ol.ID += uint(by) 399 return ol 400 } 401 402 func (ol OriginV40Location) SetParentID(id uint) OriginV40Location { 403 ol.ParentID = id 404 return ol 405 } 406 407 type OriginV40LocationIncrement uint 408 409 const ( 410 NoIncrementV30 OriginV40LocationIncrement = 0 411 SingleIncrementV30 OriginV40LocationIncrement = 1 412 ) 413 414 type FinishGetV30 struct { 415 Origin OriginV40 `json:"origin"` 416 Plan GetPlanV40 `json:"plan"` 417 ExitStatus int `json:"exit_status"` 418 FetchedVersion atc.Version `json:"version"` 419 FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"` 420 } 421 422 func (FinishGetV30) EventType() atc.EventType { return "finish-get" } 423 func (FinishGetV30) Version() atc.EventVersion { return "3.0" } 424 425 type FinishPutV30 struct { 426 Origin OriginV40 `json:"origin"` 427 Plan PutPlanV40 `json:"plan"` 428 CreatedVersion atc.Version `json:"version"` 429 CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"` 430 ExitStatus int `json:"exit_status"` 431 } 432 433 func (FinishPutV30) EventType() atc.EventType { return "finish-put" } 434 func (FinishPutV30) Version() atc.EventVersion { return "3.0" } 435 436 type InitializeGetV10 struct { 437 Origin Origin `json:"origin"` 438 } 439 440 func (InitializeGetV10) EventType() atc.EventType { return "initialize-get" } 441 func (InitializeGetV10) Version() atc.EventVersion { return "1.0" } 442 443 type InitializePutV10 struct { 444 Origin Origin `json:"origin"` 445 } 446 447 func (InitializePutV10) EventType() atc.EventType { return "initialize-put" } 448 func (InitializePutV10) Version() atc.EventVersion { return "1.0" } 449 450 type StartTaskV40 struct { 451 Time int64 `json:"time"` 452 Origin Origin `json:"origin"` 453 } 454 455 func (StartTaskV40) EventType() atc.EventType { return "start-task" } 456 func (StartTaskV40) Version() atc.EventVersion { return "4.0" } 457 458 type GetPlanV40 struct { 459 Name string `json:"name"` 460 Resource string `json:"resource"` 461 Type string `json:"type"` 462 Version atc.Version `json:"version"` 463 } 464 465 type PutPlanV40 struct { 466 Name string `json:"name"` 467 Resource string `json:"resource"` 468 Type string `json:"type"` 469 } 470 471 type FinishGetV40 struct { 472 Origin Origin `json:"origin"` 473 Plan GetPlanV40 `json:"plan"` 474 ExitStatus int `json:"exit_status"` 475 FetchedVersion atc.Version `json:"version"` 476 FetchedMetadata []atc.MetadataField `json:"metadata,omitempty"` 477 } 478 479 func (FinishGetV40) EventType() atc.EventType { return EventTypeFinishGet } 480 func (FinishGetV40) Version() atc.EventVersion { return "4.0" } 481 482 type FinishPutV40 struct { 483 Origin Origin `json:"origin"` 484 Plan PutPlanV40 `json:"plan"` 485 CreatedVersion atc.Version `json:"version"` 486 CreatedMetadata []atc.MetadataField `json:"metadata,omitempty"` 487 ExitStatus int `json:"exit_status"` 488 } 489 490 func (FinishPutV40) EventType() atc.EventType { return EventTypeFinishPut } 491 func (FinishPutV40) Version() atc.EventVersion { return "4.0" }