fix: kafka tls config

This commit is contained in:
loveuer
2025-04-07 15:44:24 +08:00
parent 2e13671bb7
commit b8905b53f9
4 changed files with 37 additions and 25 deletions

View File

@@ -1,6 +1,7 @@
package kafka
import (
"crypto/tls"
"ultone/internal/interfaces"
"github.com/segmentio/kafka-go/sasl/plain"
@@ -14,6 +15,14 @@ func WithPlainAuth(username, password string) OptionFn {
Username: username,
Password: password,
}
c.d.SASLMechanism = c.mechanism
}
}
func WithTLS(config *tls.Config) OptionFn {
return func(c *client) {
c.tls = config
c.d.TLS = config
}
}