Added SubscribeForMetadata() to the sarama client, to access the header field of each received message.
Also replaced TestKafkaClientImplementsKafkaClientIf() with static checks.
For VOL-2207. Please consider these related patchsets together:
https://gerrit.opencord.org/#/q/VOL-2207
Change-Id: I77f03fbb0ebcdf60cb5f8d0c8c3276325510e874
diff --git a/pkg/mocks/kafka_client.go b/pkg/mocks/kafka_client.go
index 51bd532..62af5db 100644
--- a/pkg/mocks/kafka_client.go
+++ b/pkg/mocks/kafka_client.go
@@ -26,6 +26,9 @@
"google.golang.org/grpc/status"
)
+// static check to ensure KafkaClient implements kafka.Client
+var _ kafka.Client = &KafkaClient{}
+
type KafkaClient struct {
topicsChannelMap map[string][]chan *ic.InterContainerMessage
lock sync.RWMutex
@@ -108,6 +111,10 @@
return nil
}
+func (kc *KafkaClient) SubscribeForMetadata(_ func(fromTopic string, timestamp int64)) {
+ panic("unimplemented")
+}
+
func (kc *KafkaClient) Send(msg interface{}, topic *kafka.Topic, keys ...string) error {
req, ok := msg.(*ic.InterContainerMessage)
if !ok {