feat: Add connection

This commit is contained in:
sujit
2024-10-22 16:56:59 +05:45
parent d703f5f1d3
commit c47f8c9acc
7 changed files with 48 additions and 39 deletions

View File

@@ -107,7 +107,7 @@ type TLSConfig struct {
type Options struct {
consumerOnSubscribe func(ctx context.Context, topic, consumerName string)
consumerOnClose func(ctx context.Context, topic, consumerName string)
notifyResponse func(context.Context, Result)
notifyResponse func(context.Context, Result) error
tlsConfig TLSConfig
brokerAddr string
callback []func(context.Context, Result) Result
@@ -175,9 +175,9 @@ func SetupOptions(opts ...Option) *Options {
return options
}
func WithNotifyResponse(handler func(ctx context.Context, result Result)) Option {
func WithNotifyResponse(callback Callback) Option {
return func(opts *Options) {
opts.notifyResponse = handler
opts.notifyResponse = callback
}
}