aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go49
1 files changed, 49 insertions, 0 deletions
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..ba853e1
--- /dev/null
+++ b/main.go
@@ -0,0 +1,49 @@
+package main
+
+import (
+ "io/ioutil"
+ "log"
+
+ "gopkg.in/yaml.v1"
+)
+
+type Config struct {
+ Auth struct {
+ Username string
+ PasswordCmd string `yaml:"password_cmd"`
+ }
+ Fields struct {
+ PersonID uint `yaml:"person_id"`
+ Clients []struct {
+ ID uint
+ Name string
+ Projects []struct {
+ ID uint
+ Name string
+ Modules []struct {
+ ID uint
+ Name string
+ }
+ Tasks []struct {
+ ID uint
+ Name string
+ }
+ WorkTypes []struct {
+ ID uint
+ Name string
+ } `yaml:"work_types"`
+ }
+ }
+ }
+}
+
+func main() {
+ config_str, err := ioutil.ReadFile("config.yml")
+ config := Config{}
+ err = yaml.Unmarshal(config_str, &config)
+ if err != nil {
+ log.Println(err)
+ }
+
+ log.Printf("%+v", config)
+}