mirror of https://github.com/tidwall/tile38.git
Add endpoint option for sasl
This commit is contained in:
parent
55e503c378
commit
e4b03ca174
|
@ -66,6 +66,7 @@ type Endpoint struct {
|
|||
Host string
|
||||
Port int
|
||||
TopicName string
|
||||
SASL bool
|
||||
TLS bool
|
||||
CACertFile string
|
||||
CertFile string
|
||||
|
@ -423,6 +424,8 @@ func parseEndpoint(s string) (Endpoint, error) {
|
|||
endpoint.Kafka.CertFile = val[0]
|
||||
case "key":
|
||||
endpoint.Kafka.KeyFile = val[0]
|
||||
case "sasl":
|
||||
endpoint.Kafka.SASL, _ = strconv.ParseBool(val[0])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,9 @@ func (conn *KafkaConn) Send(msg string) error {
|
|||
}
|
||||
cfg.Net.TLS.Enable = true
|
||||
cfg.Net.TLS.Config = tlsConfig
|
||||
} else {
|
||||
}
|
||||
|
||||
if conn.ep.Kafka.SASL {
|
||||
log.Debugf("building kafka sasl config")
|
||||
cfg.ClientID = "sasl_scram_client"
|
||||
cfg.Net.SASL.Enable = true
|
||||
|
|
Loading…
Reference in New Issue