dendrite/common/sarama.go
2020-03-12 10:23:59 +00:00

15 lines
294 B
Go

package common
import "gopkg.in/Shopify/sarama.v1"
func SaramaHeaders(headers []*sarama.RecordHeader) map[string][]byte {
result := make(map[string][]byte)
for _, header := range headers {
if header == nil {
continue
}
result[string(header.Key)] = header.Value
}
return result
}