Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSASLInvalidAuth = errors.New("invalid sasl auth, please specify both saslUsername and saslPassword")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Servers is a list of Kafka bootstrap servers, which will be used to // discover all the servers in a cluster. Servers []string `json:"servers" validate:"required"` // ClientID is a unique identifier for client connections established by // this connector. ClientID string `json:"clientID" default:"conduit-connector-kafka"` ConfigSASL ConfigTLS // contains filtered or unexported fields }
Config contains common configuration parameters.
func (Config) FranzClientOpts ¶
FranzClientOpts returns the kafka client options derived from the common config.
func (Config) TryDial ¶
TryDial tries to establish a connection to brokers and returns nil if it succeeds to connect to at least one broker.
type ConfigSASL ¶
type ConfigSASL struct { // Mechanism configures the connector to use SASL authentication. If // empty, no authentication will be performed. Mechanism string `json:"saslMechanism" validate:"inclusion=PLAIN|SCRAM-SHA-256|SCRAM-SHA-512"` // Username sets up the username used with SASL authentication. Username string `json:"saslUsername"` // Password sets up the password used with SASL authentication. Password string `json:"saslPassword"` }
func (ConfigSASL) SASL ¶
func (c ConfigSASL) SASL() sasl.Mechanism
SASL returns the SASL mechanism or nil.
type ConfigTLS ¶
type ConfigTLS struct { // TLSEnabled defines whether TLS is needed to communicate with the Kafka cluster. TLSEnabled bool `json:"tls.enabled"` // ClientCert is the Kafka client's certificate. ClientCert string `json:"clientCert"` // ClientKey is the Kafka client's private key. ClientKey string `json:"clientKey"` // CACert is the Kafka broker's certificate. CACert string `json:"caCert"` // InsecureSkipVerify defines whether to validate the broker's certificate // chain and host name. If 'true', accepts any certificate presented by the // server and any host name in that certificate. InsecureSkipVerify bool `json:"insecureSkipVerify"` }
Click to show internal directories.
Click to hide internal directories.