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

107
pkg/kafka/topics.go Normal file
View File

@@ -0,0 +1,107 @@
package kafka
const AttendantService = "attendant_service"
const AttendantServiceGRPCKafka = "attendant_service_grpc_kafka"
const CargoService = "cargo_service"
const DepotService = "depot_service"
const DepotServiceGRPCKafka = "depot_service_grpc_kafka"
const ValetService = "valet_service"
const ValetServiceGRPCKafka = "valet_service_grpc_kafka"
const LogService = "trexlog_service"
const LogServiceGRPCKafka = "trexlog_service_grpc_kafka" // Stand in so that messages converted to grpc are sent to grpc service, and does not mess with old kafka messages
const VehicleSignal = "vehicle_signal"
const VehicleData = "vehicle_data"
const OTAUpdateService = "ota_update"
const SubscriptionService = "subscription"
const RegexVehicleData = "^[A-Z0-9]{17}"
// TRexHandlerTopics designates message topics
// for handlers to destination service
var TRexHandlerTopics = map[string]string{
"init": DepotServiceGRPCKafka,
"del": DepotServiceGRPCKafka,
"consent": DepotServiceGRPCKafka,
"car_state": AttendantServiceGRPCKafka,
"car_update_status": AttendantServiceGRPCKafka,
"car_update_download": AttendantServiceGRPCKafka,
"car_update_install": AttendantServiceGRPCKafka,
"ecc_keys": AttendantServiceGRPCKafka,
"get_filekeys": AttendantServiceGRPCKafka,
"dtcs": AttendantServiceGRPCKafka,
"charge_settings": ValetServiceGRPCKafka,
"departure_schedule": ValetServiceGRPCKafka,
"charging_command": ValetServiceGRPCKafka,
"error": LogServiceGRPCKafka,
"trex_log": LogServiceGRPCKafka,
"hmi_log": LogServiceGRPCKafka,
"mobile_log": LogServiceGRPCKafka,
"canbus": VehicleData,
}
// HMIHandlerTopics designates message topics
// for handlers to destination service
var HMIHandlerTopics = map[string]string{
"init": DepotServiceGRPCKafka,
"del": DepotServiceGRPCKafka,
"car_update_download": AttendantServiceGRPCKafka,
"car_update_install": AttendantServiceGRPCKafka,
"car_update_status": AttendantServiceGRPCKafka,
"get_filekeys": AttendantServiceGRPCKafka,
"update_approve": AttendantServiceGRPCKafka,
"consent": ValetServiceGRPCKafka,
"ble_key": ValetServiceGRPCKafka,
"map_history": ValetServiceGRPCKafka,
"profiles": ValetServiceGRPCKafka,
"profile_delete": ValetServiceGRPCKafka,
"settings_update": ValetServiceGRPCKafka,
"user_pois": ValetServiceGRPCKafka,
}
// MobileHandlerTopics designates message topics
// for handlers to destination service
var MobileHandlerTopics = map[string]string{
"init": DepotServiceGRPCKafka,
"del": DepotServiceGRPCKafka,
"update_approve": AttendantServiceGRPCKafka,
"updates_get": AttendantServiceGRPCKafka,
"remote_command": ValetServiceGRPCKafka,
"car_locations": ValetServiceGRPCKafka,
"charge_settings": ValetServiceGRPCKafka,
"charge_settings_get": ValetServiceGRPCKafka,
"digital_twin": ValetServiceGRPCKafka,
"departure_schedule": ValetServiceGRPCKafka,
"departure_schedule_get": ValetServiceGRPCKafka,
"map_destination": ValetServiceGRPCKafka,
"map_route": ValetServiceGRPCKafka,
"map_history_get": ValetServiceGRPCKafka,
"map_history_add": ValetServiceGRPCKafka,
"ota_install": ValetServiceGRPCKafka,
"profiles": ValetServiceGRPCKafka,
"settings_update": ValetServiceGRPCKafka,
"store_inventory": ValetServiceGRPCKafka,
"store_purchase": ValetServiceGRPCKafka,
"user_pois_get": ValetServiceGRPCKafka,
"user_poi_create": ValetServiceGRPCKafka,
"user_poi_edit": ValetServiceGRPCKafka,
"user_poi_delete": ValetServiceGRPCKafka,
"wake_car": ValetServiceGRPCKafka,
"manual_issue": ValetServiceGRPCKafka,
}
// ServiceHandlerTopics designates message topics
// for handlers to destination service. For routing
// messages between cloud services
var ServiceHandlerTopics = map[string]string{
"send_manifest": AttendantServiceGRPCKafka,
"sms_delivery_status_manifest": AttendantServiceGRPCKafka,
"remote_command": ValetServiceGRPCKafka,
}