Fix job encode decode

This commit is contained in:
bel
2020-03-15 16:13:44 +00:00
parent 2efb0bfcf3
commit f4016da220
21 changed files with 232 additions and 41 deletions

20
scheduler/runner.go Normal file → Executable file
View File

@@ -5,3 +5,23 @@ type Runner int
const (
Bash Runner = iota + 1
)
func (r Runner) String() string {
switch r {
case Bash:
return "bash"
default:
return ""
}
}
func NewRunner(s string) Runner {
for _, r := range []Runner{
Bash,
} {
if r.String() == s {
return r
}
}
return 0
}