Creates a valid instance of `CheckStatusInfo` with the `type` set in accordance to the associated `CheckInfo`.
| 59 | // Creates a valid instance of `CheckStatusInfo` with the `type` set in |
| 60 | // accordance to the associated `CheckInfo`. |
| 61 | static CheckStatusInfo createEmptyCheckStatusInfo(const CheckInfo& checkInfo) { |
| 62 | CheckStatusInfo checkStatusInfo; |
| 63 | checkStatusInfo.set_type(checkInfo.type()); |
| 64 | |
| 65 | switch (checkInfo.type()) { |
| 66 | case CheckInfo::COMMAND: { |
| 67 | checkStatusInfo.mutable_command(); |
| 68 | break; |
| 69 | } |
| 70 | case CheckInfo::HTTP: { |
| 71 | checkStatusInfo.mutable_http(); |
| 72 | break; |
| 73 | } |
| 74 | case CheckInfo::TCP: { |
| 75 | checkStatusInfo.mutable_tcp(); |
| 76 | break; |
| 77 | } |
| 78 | case CheckInfo::UNKNOWN: { |
| 79 | LOG(FATAL) << "Received UNKNOWN check type"; |
| 80 | break; |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | return checkStatusInfo; |
| 85 | } |
| 86 | |
| 87 | |
| 88 | Try<Owned<Checker>> Checker::create( |
no test coverage detected