aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/nekocrawl.go10
-rw-r--r--cmd/nekoweb.go10
-rw-r--r--cmd/util.go18
3 files changed, 38 insertions, 0 deletions
diff --git a/cmd/nekocrawl.go b/cmd/nekocrawl.go
new file mode 100644
index 0000000..e1dd6d0
--- /dev/null
+++ b/cmd/nekocrawl.go
@@ -0,0 +1,10 @@
+package main
+
+import (
+ "neko/crawler"
+ _ "neko/util"
+)
+
+func main() {
+ crawler.Crawl()
+}
diff --git a/cmd/nekoweb.go b/cmd/nekoweb.go
new file mode 100644
index 0000000..bebfebf
--- /dev/null
+++ b/cmd/nekoweb.go
@@ -0,0 +1,10 @@
+package main
+
+import (
+ "neko/web"
+ _ "neko/util"
+)
+
+func main() {
+ web.Serve()
+}
diff --git a/cmd/util.go b/cmd/util.go
new file mode 100644
index 0000000..ca12fdb
--- /dev/null
+++ b/cmd/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)
+}