Pawel Wieczorek | 76dd9bf | 2019-09-26 16:43:01 +0200 | [diff] [blame^] | 1 | package check |
| 2 | |
| 3 | // Informer collects and returns information on cluster. |
| 4 | type Informer interface { |
| 5 | // GetAPIParams returns API server parameters. |
| 6 | GetAPIParams() ([]string, error) |
| 7 | } |
| 8 | |
| 9 | // Command represents commands run on cluster. |
| 10 | type Command int |
| 11 | |
| 12 | const ( |
| 13 | // APIProcess represents API server command ("kube-apiserver"). |
| 14 | APIProcess Command = iota |
| 15 | ) |
| 16 | |
| 17 | func (c Command) String() string { |
| 18 | names := [...]string{ |
| 19 | "kube-apiserver", |
| 20 | } |
| 21 | |
| 22 | if c < APIProcess || c > APIProcess { |
| 23 | return "exit" |
| 24 | } |
| 25 | return names[c] |
| 26 | } |
| 27 | |
| 28 | // Service represents services run on Rancher-based cluster. |
| 29 | type Service int |
| 30 | |
| 31 | const ( |
| 32 | // APIService represents API server service ("kubernetes/kubernetes"). |
| 33 | APIService Service = iota |
| 34 | ) |
| 35 | |
| 36 | func (s Service) String() string { |
| 37 | names := [...]string{ |
| 38 | "kubernetes/kubernetes", |
| 39 | } |
| 40 | |
| 41 | if s < APIService || s > APIService { |
| 42 | return "" |
| 43 | } |
| 44 | return names[s] |
| 45 | } |