github.com/cilium/cilium@v1.16.2/tools/dev-doctor/check.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright Authors of Cilium 3 4 package main 5 6 // A checkResult is the result of a check. 7 type checkResult int 8 9 const ( 10 checkSkipped checkResult = -1 // The check was skipped. 11 checkOK checkResult = 0 // The check completed and did not find any problems. 12 checkInfo checkResult = 1 // The check completed and found something of interest which is probably not a problem. 13 checkWarning checkResult = 2 // The check completed and found something that might indicate a problem. 14 checkError checkResult = 3 // The check completed and found a definite problem. 15 checkFailed checkResult = 4 // The check could not be completed. 16 ) 17 18 // A check is an individual check. 19 type check interface { 20 Name() string // Name returns the check's name. 21 Run() (checkResult, string) // Run runs the check. 22 Hint() string // Hint returns a hint on how to fix the problem, if any. 23 } 24 25 var checkResultStr = map[checkResult]string{ 26 checkSkipped: "skipped", 27 checkOK: "ok", 28 checkInfo: "info", 29 checkWarning: "warning", 30 checkError: "error", 31 checkFailed: "failed", 32 }