cmd: remove global state in main.go

* refactoring
* Now supporting default config locations
This commit is contained in:
Christian Schwarz
2017-09-17 18:20:05 +02:00
parent 4ac7e78e2b
commit 9cd83399d3
9 changed files with 148 additions and 77 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ type SourceJob struct {
Debug JobDebugSettings
}
func parseSourceJob(name string, i map[string]interface{}) (j *SourceJob, err error) {
func parseSourceJob(c JobParsingContext, name string, i map[string]interface{}) (j *SourceJob, err error) {
var asMap struct {
Serve map[string]interface{}
@@ -38,7 +38,7 @@ func parseSourceJob(name string, i map[string]interface{}) (j *SourceJob, err er
j = &SourceJob{Name: name}
if j.Serve, err = parseAuthenticatedChannelListenerFactory(asMap.Serve); err != nil {
if j.Serve, err = parseAuthenticatedChannelListenerFactory(c, asMap.Serve); err != nil {
return
}