From f3bbad68aefb0c32aa20349fe6ddfd6d3322a3e0 Mon Sep 17 00:00:00 2001 From: Eray Arslan Date: Sat, 20 Jul 2024 13:54:17 +0300 Subject: [PATCH] feat: expose dcp client on connector --- connector.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/connector.go b/connector.go index d47bae8..7091690 100644 --- a/connector.go +++ b/connector.go @@ -5,6 +5,8 @@ import ( "fmt" "os" + dcpCouchbase "github.com/Trendyol/go-dcp/couchbase" + "github.com/Trendyol/go-dcp/helpers" "github.com/sirupsen/logrus" @@ -29,6 +31,7 @@ var MetadataTypeKafka = "kafka" type Connector interface { Start() Close() + GetDcpClient() dcpCouchbase.Client } type connector struct { @@ -54,6 +57,10 @@ func (c *connector) Close() { } } +func (c *connector) GetDcpClient() dcpCouchbase.Client { + return c.dcp.GetClient() +} + func (c *connector) produce(ctx *models.ListenerContext) { var e couchbase.Event switch event := ctx.Event.(type) {