Load config from yaml file. Cleanup. Should now actually work.
This commit is contained in:
+6
-25
@@ -2,34 +2,15 @@ package executors
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/munnerz/plex-elastic-transcoder/common"
|
||||
)
|
||||
|
||||
type Job struct {
|
||||
Command []string
|
||||
Args []string
|
||||
}
|
||||
|
||||
type Executor interface {
|
||||
Start() error
|
||||
Stop() error
|
||||
WaitForState(ExecutorPhase) error
|
||||
String() string
|
||||
}
|
||||
|
||||
type AbstractExecutor struct {
|
||||
Job Job
|
||||
Config common.Config
|
||||
Job common.Job
|
||||
}
|
||||
|
||||
type ExecutorPhase string
|
||||
|
||||
const (
|
||||
ExecutorPreparing ExecutorPhase = "Preparing"
|
||||
ExecutorRunning ExecutorPhase = "Running"
|
||||
ExecutorSucceeded ExecutorPhase = "Succeeded"
|
||||
ExecutorFailed ExecutorPhase = "Failed"
|
||||
ExecutorUnknown ExecutorPhase = "Unknown"
|
||||
)
|
||||
|
||||
func (e *AbstractExecutor) Start() error {
|
||||
return nil
|
||||
}
|
||||
@@ -38,10 +19,10 @@ func (e *AbstractExecutor) Stop() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *AbstractExecutor) WaitForState(p ExecutorPhase) error {
|
||||
func (e *AbstractExecutor) WaitForState(p common.ExecutorPhase) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *AbstractExecutor) String() string {
|
||||
return fmt.Sprintf("%s %s", e.Job.Command, e.Job.Args)
|
||||
return fmt.Sprintf("%s", e.Job.Args)
|
||||
}
|
||||
Reference in New Issue
Block a user