aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/util.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/util/util.go b/util/util.go
new file mode 100644
index 0000000..ca12fdb
--- /dev/null
+++ b/util/util.go
@@ -0,0 +1,18 @@
+package util
+
+import (
+ "neko/config"
+ "neko/models"
+ "os"
+)
+
+var DEFAULT_CONFIG = "config.json"
+
+func init() {
+ var configFile = DEFAULT_CONFIG
+ if len(os.Args) > 1 {
+ configFile = os.Args[1]
+ }
+ config.Read(configFile)
+ models.InitDB(config.Config.DBServer)
+}