Load config from yaml file. Cleanup. Should now actually work.

This commit is contained in:
James Munnelly
2016-04-24 22:05:53 +01:00
parent fd9a28ad5d
commit 724e44f61d
6 changed files with 198 additions and 171 deletions
+6 -25
View File
@@ -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)
}