temp push
This commit is contained in:
26
controller/controller.go
Normal file
26
controller/controller.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"homestead/homestead_gateway/util/config"
|
||||
"homestead/homestead_gateway/util/logger"
|
||||
"homestead/homestead_gateway/ws"
|
||||
)
|
||||
|
||||
func NewGatewayController(cfg config.Config) GatewayController {
|
||||
wsl, wCloseFn, err := logger.New("Websocket", cfg.Log)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
modHandler := ws.NewLoggingModHandler(wsl)
|
||||
botHandler := ws.NewLoggingBotHandler(wsl)
|
||||
|
||||
return GatewayController{
|
||||
Websocket: ws.NewWsGateway(cfg.Gateway, wsl, wCloseFn, modHandler, botHandler),
|
||||
HttpServer: HttpGateway{},
|
||||
}
|
||||
}
|
||||
|
||||
func (gc *GatewayController) Run() error {
|
||||
return gc.Websocket.Start()
|
||||
}
|
||||
Reference in New Issue
Block a user