Initial cloud-services repo - gateway service + pkg modules

This commit is contained in:
Chris Rai
2026-01-30 23:14:52 -05:00
commit fbb820d7b3
1037 changed files with 171318 additions and 0 deletions

44
services/gateway/main.go Normal file
View File

@@ -0,0 +1,44 @@
package main
import (
"context"
"gateway/controllers"
"gateway/server"
"gateway/services"
"gateway/sloppy"
"fiskerinc.com/modules/logger"
"fiskerinc.com/modules/tracer"
"fiskerinc.com/modules/utils/app"
)
func init() {
app.Setup("gateway", cleanup)
}
func main() {
defer cleanup()
tracer.Start()
defer tracer.Stop()
const port string = ":8077"
const kafkaTopic string = "ota_update"
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
// Initiate vin blocking list early
sloppy.GetVINBlocker()
go controllers.HealthCheck()
go server.StartRedisQueue(ctx)
go server.StartRedisSubscriptions(ctx)
go services.GetConnections().RunExpiration(ctx)
go server.StartHTTP(ctx, port)
select {}
}
func cleanup() {
logger.Close()
}