Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // SHA256 - hash function for SCRAM. SHA256 scram.HashGeneratorFcn = sha256.New //nolint:gochecknoglobals // ok // SHA512 - hash function for SCRAM. SHA512 scram.HashGeneratorFcn = sha512.New //nolint:gochecknoglobals // ok )
View Source
var KafkaVersion = sarama.V3_4_0_0 //nolint:gochecknoglobals // ok
KafkaVersion is the default Kafka version.
Functions ¶
func PrepareDefaultConfigSASL ¶
func PrepareDefaultConfigSASL( config *sarama.Config, mechanism sarama.SASLMechanism, user string, password string, )
PrepareDefaultConfigSASL prepares the configuration for creating a producer or consumer with SASL.
func SaslMechanismFromString ¶
func SaslMechanismFromString(saslMechanism string) (sarama.SASLMechanism, error)
SaslMechanismFromString converts a config string to the corresponding SASL type in sarama. Can be helpful for config parsing.
func ValidateClientID ¶
ValidateClientID checks the validity of ClientID for Kafka.
Types ¶
type XDGSCRAMClient ¶
type XDGSCRAMClient struct { *scram.Client *scram.ClientConversation scram.HashGeneratorFcn }
XDGSCRAMClient implements sarama.SCRAMClient interface for SASL configuration https://github.com/IBM/sarama/blob/main/examples/sasl_scram_client/scram_client.go
func NewXDGSCRAMClient ¶
func NewXDGSCRAMClient(hashGeneratorFcn scram.HashGeneratorFcn) *XDGSCRAMClient
NewXDGSCRAMClient creates a new instance of XDGSCRAMClient.
func (*XDGSCRAMClient) Begin ¶
func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)
Begin starts SASL session.
Click to show internal directories.
Click to hide internal directories.