diff options
| author | Alexander Kavon <hawk@alexkavon.com> | 2023-11-13 23:30:18 -0500 |
|---|---|---|
| committer | Alexander Kavon <hawk@alexkavon.com> | 2023-11-13 23:30:18 -0500 |
| commit | 699e1edf05207f906583659fb250269ad5ec1f36 (patch) | |
| tree | e18c7137f3f710fc25045e68f63d0e7a1acd3930 /conf | |
| parent | fa63d31876bb522d6bd3dd2322c6f55f5c667a9c (diff) | |
scaffolding
Diffstat (limited to 'conf')
| -rw-r--r-- | conf/conf.go | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/conf/conf.go b/conf/conf.go deleted file mode 100644 index d135fcb..0000000 --- a/conf/conf.go +++ /dev/null @@ -1,35 +0,0 @@ -package conf - -import ( - "log" - "os" - "github.com/BurntSushi/toml" -) - -type Conf struct { - DbAdapter string `toml:"DB_ADAPTER"` - DbUser string `toml:"DB_USER"` - DbPassword string `toml:"DB_PASS"` -} - -func Load() *Conf { - - filepath := os.Getenv("NEWSSTAND_CONFIG_PATH") - if filepath == "" { - workingdir, err := os.Getwd() - if err != nil { - log.Fatal(err) - } - filepath = workingdir + "/.newsstandrc.toml" - } - log.Printf("Config file path: %s", filepath) - - var c Conf - _, err := toml.DecodeFile(filepath, &c) - if err != nil { - log.Fatalln(err) - } - log.Println(c.DbAdapter) - - return &c -} |
