add flag options, add schema submodule

This commit is contained in:
Jay
2018-09-19 20:23:39 +08:00
parent e86171151a
commit a43bf98e21
7 changed files with 71 additions and 2 deletions
+6 -1
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"log"
"git.trj.tw/golang/mtfosbot/module/config"
"git.trj.tw/golang/mtfosbot/module/context"
"git.trj.tw/golang/mtfosbot/router/api"
"git.trj.tw/golang/mtfosbot/router/google"
@@ -19,7 +20,11 @@ import (
func NewServ() *gin.Engine {
r := gin.New()
store, err := sessions.NewRedisStore(10, "tcp", "localhost:6379", "", []byte("seckey"))
conf := config.GetConf()
redisStr := fmt.Sprintf("%s:%d", conf.Redis.Host, conf.Redis.Port)
store, err := sessions.NewRedisStore(10, "tcp", redisStr, "", []byte("seckey"))
if err != nil {
log.Fatal(err)
}