diff options
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -5,9 +5,21 @@ import ( "os" "path/filepath" + "github.com/teddywing/timetasker/timetask" + + "github.com/BurntSushi/toml" "github.com/goulash/xdg" ) +type Config struct { + Auth struct { + Username string + PasswordCmd string `toml:"password_cmd"` + } + Profile timetask.Profile + Projects map[string]timetask.Project +} + const emptyConfig = `[auth] username = "" password_cmd = "" @@ -44,3 +56,13 @@ func MaybeWriteConfig() error { return nil } + +func loadConfig() error { + config = Config{} + _, err := toml.DecodeFile("config2.toml", &config) + if err != nil { + return err + } + + return nil +} |