Support YAML for the configuration and rearrange the config struct

This commit is contained in:
Tony Blyler 2016-05-14 10:22:10 -04:00
parent fb15dcf3d5
commit 95ce7fccee
No known key found for this signature in database
GPG key ID: 25C9D3A655D1A65C
3 changed files with 69 additions and 66 deletions
cmd/hoarder

View file

@ -1,9 +1,9 @@
package main
import (
"encoding/json"
"flag"
"github.com/tblyler/hoarder/queue"
"gopkg.in/yaml.v2"
"io/ioutil"
"log"
"os"
@ -28,7 +28,7 @@ func main() {
}
config := &queue.Config{}
err = json.Unmarshal(configRaw, config)
err = yaml.Unmarshal(configRaw, config)
if err != nil {
logger.Printf("Unable to decode config json at '%s': '%s'", *configPath, err)
os.Exit(1)