45 lines
772 B
Go
45 lines
772 B
Go
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()
|
|
}
|