aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorAdam Mathes <adam@trenchant.org>2017-01-23 20:04:03 -0800
committerAdam Mathes <adam@trenchant.org>2017-01-23 20:04:03 -0800
commit93d6d36eb697cd9452eb4aab446151a1a33ed245 (patch)
treec9cb88718d03a6964f6d3705066f11d356257d37 /config
downloadneko-93d6d36eb697cd9452eb4aab446151a1a33ed245.tar.gz
neko-93d6d36eb697cd9452eb4aab446151a1a33ed245.tar.bz2
neko-93d6d36eb697cd9452eb4aab446151a1a33ed245.zip
neko v2 initial commit
Diffstat (limited to 'config')
-rw-r--r--config/config.go29
1 files changed, 29 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go
new file mode 100644
index 0000000..59baa2b
--- /dev/null
+++ b/config/config.go
@@ -0,0 +1,29 @@
+package config
+
+import (
+ "encoding/json"
+ "io/ioutil"
+ "log"
+)
+
+type Settings struct {
+ DBServer string
+ WebServer string
+ Username string
+ Realm string
+ DigestPassword string
+}
+
+var Config Settings
+
+func Read(filename string) {
+ file, e := ioutil.ReadFile(filename)
+ if e != nil {
+ log.Fatal("Can not read config file", e)
+ }
+
+ e = json.Unmarshal(file, &Config)
+ if e != nil {
+ log.Fatal("Config read error", e)
+ }
+}