aboutsummaryrefslogtreecommitdiff
path: root/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'parse.go')
-rw-r--r--parse.go34
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
-}