Serge Bazanski | 3d116b2 | 2021-03-27 15:43:18 +0000 | [diff] [blame] | 1 | syntax = "proto3"; |
| 2 | package proto; |
| 3 | option go_package = "code.hackerspace.pl/hscloud/personal/q3k/shipstuck/proto"; |
| 4 | |
| 5 | import "google/api/annotations.proto"; |
| 6 | |
| 7 | service ShipStuck { |
| 8 | rpc Status(StatusRequest) returns (StatusResponse) { |
| 9 | option (google.api.http) = { |
| 10 | get: "/v1/shipstuck/status" |
| 11 | }; |
| 12 | }; |
| 13 | } |
| 14 | |
| 15 | message StatusRequest { |
| 16 | } |
| 17 | |
| 18 | message StatusResponse { |
| 19 | // Timestamp (nanos from epoch) of last check. |
| 20 | int64 last_checked = 1; |
| 21 | enum Stuckness { |
| 22 | STUCKNESS_INVALID = 0; |
| 23 | STUCKNESS_STUCK = 1; |
| 24 | STUCKNESS_FREE = 2; |
| 25 | STUCKNESS_UNKNOWN = 3; |
Serge Bazanski | a4ae66b | 2021-03-29 13:26:37 +0000 | [diff] [blame] | 26 | STUCKNESS_TOWED = 4; |
Serge Bazanski | 3d116b2 | 2021-03-27 15:43:18 +0000 | [diff] [blame] | 27 | }; |
| 28 | Stuckness current = 2; |
Serge Bazanski | a4ae66b | 2021-03-29 13:26:37 +0000 | [diff] [blame] | 29 | // If STUCK or TOWED, how many nanoseconds have elapsed since the whoopsie? |
Serge Bazanski | 3d116b2 | 2021-03-27 15:43:18 +0000 | [diff] [blame] | 30 | int64 elapsed = 3; |
| 31 | } |