[VOL-1024] This update consists of:
1) Inter-container kafka library in Go
2) initial set of proto definitions
3) Test cases for the kafka library
Change-Id: Ibe8b0f673a90bbe4cb92847ce40f31ec2d0b6244
diff --git a/kafka/messaging_interface.go b/kafka/messaging_interface.go
new file mode 100644
index 0000000..3511dc7
--- /dev/null
+++ b/kafka/messaging_interface.go
@@ -0,0 +1,30 @@
+package kafka
+
+import (
+ "context"
+)
+
+type callback func(bool, interface{})
+
+// A Topic definition - may be augmented with additional attributes eventually
+type Topic struct {
+ // The name of the topic. It must start with a letter,
+ // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`),
+ // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent
+ // signs (`%`).
+ Name string
+}
+
+type KVArg struct {
+ Key string
+ Value interface{}
+}
+
+// Client represents the set of APIs a Messaging Client must implement - In progress
+type Client interface {
+ Start()
+ Stop()
+ Subscribe(ctx context.Context, topic *Topic, cb callback, targetInterfaces ...interface{})
+ Publish(ctx context.Context, rpc string, cb callback, topic *Topic, waitForResponse bool, kvArgs ...*KVArg)
+ Unsubscribe(ctx context.Context, topic *Topic)
+}