Fix job encode decode
This commit is contained in:
20
scheduler/runner.go
Normal file → Executable file
20
scheduler/runner.go
Normal file → Executable 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user