Add depot, attendant, jetfire, optimus, ota services with kustomize overlays
This commit is contained in:
37
services/optimus/main.go
Normal file
37
services/optimus/main.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/fiskerinc/cloud-services/services/optimus/controllers"
|
||||
"github.com/fiskerinc/cloud-services/services/optimus/server"
|
||||
|
||||
"github.com/fiskerinc/cloud-services/pkg/kafka"
|
||||
"github.com/fiskerinc/cloud-services/pkg/logger"
|
||||
"github.com/fiskerinc/cloud-services/pkg/tracer"
|
||||
"github.com/fiskerinc/cloud-services/pkg/utils/app"
|
||||
)
|
||||
|
||||
var (
|
||||
SERVICE_NAME = "optimus"
|
||||
)
|
||||
|
||||
func init() {
|
||||
app.Setup(SERVICE_NAME, cleanup)
|
||||
}
|
||||
|
||||
func main() {
|
||||
defer cleanup()
|
||||
tracer.Start()
|
||||
defer tracer.Stop()
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
go controllers.HealthCheck()
|
||||
go server.StartHTTPServer()
|
||||
go server.StartConsumer(ctx, []string{kafka.VehicleData})
|
||||
select {}
|
||||
}
|
||||
|
||||
func cleanup() {
|
||||
logger.Close()
|
||||
}
|
||||
Reference in New Issue
Block a user