Chromium Code Reviews| Index: milo/api/resp/builder.go |
| diff --git a/milo/api/resp/builder.go b/milo/api/resp/builder.go |
| index 46a30fe42a90870a7e15c6534760eff561072731..ac02a6ec1db957c1ec63a3135e3f843aca6fa026 100644 |
| --- a/milo/api/resp/builder.go |
| +++ b/milo/api/resp/builder.go |
| @@ -2,6 +2,8 @@ |
| // Use of this source code is governed under the Apache License, Version 2.0 |
| // that can be found in the LICENSE file. |
| +//go:generate stringer -type=BotStatus |
|
nodir
2017/06/13 02:38:40
why is it so far from the BotStatus definition? co
Ryan Tseng
2017/06/13 23:10:33
This is to get go generate to create botstatus_str
|
| + |
| package resp |
| import "time" |
| @@ -70,10 +72,26 @@ type Builder struct { |
| NextCursor string `json:",omitempty"` |
| } |
| +type BotStatus int |
| + |
| +const ( |
| + Unknown BotStatus = iota |
|
nodir
2017/06/13 02:38:40
This is a package-global constant. Consider renami
Ryan Tseng
2017/06/13 23:10:33
Done. Going to keep the below 3 as is since it ma
|
| + Idle |
| + Busy |
| + Disconnected |
| +) |
| + |
| +// Bot represents a single bot. |
| +type Bot struct { |
| + Name *Link |
| + Status BotStatus |
| +} |
| + |
| // MachinePool represents the capacity and availability of a builder. |
| type MachinePool struct { |
| - Connected int |
| - Total int |
| - Free int |
| - Used int |
| + Total int |
| + Disconnected int |
| + Idle int |
| + Busy int |
| + Bots []Bot |
| } |