package main

import (
	"github.com/fiskerinc/cloud-services/services/attendant/controllers"
	"github.com/fiskerinc/cloud-services/services/attendant/server"

	"github.com/fiskerinc/cloud-services/pkg/kafka"
	"github.com/fiskerinc/cloud-services/pkg/logger"
	"github.com/fiskerinc/cloud-services/pkg/utils/app"
)

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

func main() {
	defer cleanup()

	go controllers.HealthCheck()
	go server.StartConsumer(kafka.AttendantServiceGRPCKafka, kafka.AttendantService)

	select {}
}

func cleanup() {
	logger.Close()
}
