package main

import (
	"github.com/fiskerinc/cloud-services/services/depot/controllers"
	"github.com/fiskerinc/cloud-services/services/depot/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"
)

func init() {
	app.Setup("depot", cleanup)
}

func main() {
	defer cleanup()

	tracer.Start()
	defer tracer.Stop()

	go controllers.HealthCheck()
	go server.StartConsumer(kafka.DepotServiceGRPCKafka, kafka.DepotService)

	select {}
}

func cleanup() {
	logger.Close()
}
