diff options
| author | Grayson Koonce <grayson.koonce@gmail.com> | 2016-10-12 11:04:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-12 11:04:26 -0700 |
| commit | ac8374fd17e30fca9a7773a2a6f690a7ea4d2ec9 (patch) | |
| tree | e9a61adde4bc5eef80583f3e1d6f9379a20b4f99 /parse.go | |
| parent | b80c4f3e920994823061eb05dc0a5bc3881ddb02 (diff) | |
| download | sally-ac8374fd17e30fca9a7773a2a6f690a7ea4d2ec9.tar.gz | |
Rework as HTTP server (#15)
Diffstat (limited to 'parse.go')
| -rw-r--r-- | parse.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/parse.go b/parse.go deleted file mode 100644 index 5071f37..0000000 --- a/parse.go +++ /dev/null @@ -1,34 +0,0 @@ -package main - -import ( - "io/ioutil" - - "gopkg.in/yaml.v2" -) - -// Config represents the structure of the yaml file -type Config struct { - URL string `yaml:"url"` - Packages map[string]Package `yaml:"packages"` -} - -// Package details the options available for each repo -type Package struct { - Repo string `yaml:"repo"` -} - -// Parse takes a path to a yaml file and produces a parsed Config -func Parse(path string) (Config, error) { - var c Config - - data, err := ioutil.ReadFile(path) - if err != nil { - return c, err - } - - if err := yaml.Unmarshal(data, &c); err != nil { - return c, err - } - - return c, err -} |