package kafka import ( "context" "fmt" "github.com/segmentio/kafka-go" ) func Send(key []byte, value []byte) error { if nil == kafkaWriter { return fmt.Errorf("Kafka client is not valid") } err := kafkaWriter.WriteMessages(context.Background(), kafka.Message{ Key: key, Value: value, }, ) return err }