websocket base and command parser
This commit is contained in:
@@ -2,6 +2,7 @@ package api
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"zomo.dev/largehadroncollider/api/ws"
|
||||
"zomo.dev/largehadroncollider/db"
|
||||
"zomo.dev/largehadroncollider/ttv"
|
||||
"zomo.dev/largehadroncollider/util"
|
||||
@@ -9,8 +10,12 @@ import (
|
||||
|
||||
func InitApiServer(conf *util.Config, dbConn *db.DBConn, twitchConn *ttv.TwitchConn) (*ApiServer, error) {
|
||||
engine := gin.Default()
|
||||
wsServer, err := ws.InitWSServer(dbConn, twitchConn)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
apiServer := &ApiServer{engine, conf, dbConn, twitchConn}
|
||||
apiServer := &ApiServer{engine, wsServer, conf, dbConn, twitchConn}
|
||||
|
||||
apiServer.loadEndpoints()
|
||||
|
||||
@@ -19,6 +24,7 @@ func InitApiServer(conf *util.Config, dbConn *db.DBConn, twitchConn *ttv.TwitchC
|
||||
|
||||
type ApiServer struct {
|
||||
engine *gin.Engine
|
||||
ws *ws.WSServer
|
||||
conf *util.Config
|
||||
db *db.DBConn
|
||||
twitch *ttv.TwitchConn
|
||||
|
||||
Reference in New Issue
Block a user