feat(platform): expose source slots in vehicle service
This commit is contained in:
@@ -68,6 +68,23 @@ func missingCanonicalProtocols(protocols []string) []string {
|
||||
return missing
|
||||
}
|
||||
|
||||
func buildVehicleCoverageSourceStatus(protocols []string, onlineProtocols []string, lastSeen string) []VehicleSourceStatus {
|
||||
statuses := make([]VehicleSourceStatus, 0, len(protocols))
|
||||
for _, protocol := range protocols {
|
||||
protocol = strings.TrimSpace(protocol)
|
||||
if protocol == "" {
|
||||
continue
|
||||
}
|
||||
statuses = append(statuses, VehicleSourceStatus{
|
||||
Protocol: protocol,
|
||||
Online: containsString(onlineProtocols, protocol),
|
||||
LastSeen: lastSeen,
|
||||
HasRealtime: true,
|
||||
})
|
||||
}
|
||||
return completeVehicleSourceStatus(statuses, "")
|
||||
}
|
||||
|
||||
func NewService(store Store) *Service {
|
||||
return &Service{store: store}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user