Skip to content

Commit

Permalink
feat: expose dcp client on connector
Browse files Browse the repository at this point in the history
  • Loading branch information
erayarslan committed Jul 20, 2024
1 parent 3b2c32f commit f3bbad6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"os"

dcpCouchbase "github.com/Trendyol/go-dcp/couchbase"

"github.com/Trendyol/go-dcp/helpers"

"github.com/sirupsen/logrus"
Expand All @@ -29,6 +31,7 @@ var MetadataTypeKafka = "kafka"
type Connector interface {
Start()
Close()
GetDcpClient() dcpCouchbase.Client
}

type connector struct {
Expand All @@ -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) {
Expand Down

0 comments on commit f3bbad6

Please sign in to comment.