Files
alfred-be/alfred/cmd/collector/helper/client_identifier.go
2026-03-08 16:14:42 +05:30

23 lines
372 B
Go

package helper
import (
"alfred/utils"
"github.com/Shopify/sarama"
)
func IdentifyClientThroughHeader(headers []*sarama.RecordHeader) string {
client := utils.NAVI_USER_APP
for _, header := range headers {
key := header.Key
encodedValue := header.Value
if string(key) == utils.CLIENT_NAME {
client = string(encodedValue)
break
}
}
return client
}