23 lines
372 B
Go
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
|
|
|
|
}
|