temp push

This commit is contained in:
2025-12-01 13:40:58 +01:00
parent aac6db39c2
commit 4a668493c4
11 changed files with 559 additions and 116 deletions

26
controller/controller.go Normal file
View 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()
}

12
controller/structs.go Normal file
View File

@@ -0,0 +1,12 @@
package controller
import (
"homestead/homestead_gateway/ws"
)
type GatewayController struct {
Websocket *ws.WebsocketGateway
HttpServer HttpGateway
}
type HttpGateway struct{}