-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuration of watchdog from env-vars
Signed-off-by: Alex Ellis <[email protected]>
- Loading branch information
Showing
7 changed files
with
258 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package config | ||
|
||
const ( | ||
// ModeStreaming streams the values live to the caller as they are printed by the process. | ||
ModeStreaming = 1 | ||
|
||
// ModeSerializing reads all the response and buffers before returning | ||
ModeSerializing = 2 | ||
|
||
// ModeAfterBurn for performance tuning | ||
ModeAfterBurn = 3 | ||
) | ||
|
||
// WatchdogModeConst as a const int | ||
func WatchdogModeConst(mode string) int { | ||
switch mode { | ||
case "streaming": | ||
return ModeStreaming | ||
case "afterburn": | ||
return ModeAfterBurn | ||
case "serializing": | ||
return ModeSerializing | ||
default: | ||
return 0 | ||
} | ||
} | ||
|
||
// WatchdogMode as a string | ||
func WatchdogMode(mode int) string { | ||
switch mode { | ||
case ModeStreaming: | ||
return "streaming" | ||
case ModeAfterBurn: | ||
return "afterburn" | ||
case ModeSerializing: | ||
return "serializing" | ||
default: | ||
return "unknown" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.