kafka

package
v1.25.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 13, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package kafka contains data types, interfaces, and methods related to Kafka that can be used to configure brokers, as well as consume/produce messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaramaConfigFromBrokerConfig

func SaramaConfigFromBrokerConfig(cfg *BrokerConfiguration) (*sarama.Config, error)

SaramaConfigFromBrokerConfig returns a Config struct from broker.Configuration parameters

Types

type BrokerConfiguration

type BrokerConfiguration struct {
	// Viper does not unmarshall automagically to a slice.
	// Handling a string is easier and nicer than all the code required to do so
	Addresses        string        `mapstructure:"addresses" toml:"addresses"`
	SecurityProtocol string        `mapstructure:"security_protocol" toml:"security_protocol"`
	CertPath         string        `mapstructure:"cert_path" toml:"cert_path"`
	SaslMechanism    string        `mapstructure:"sasl_mechanism" toml:"sasl_mechanism"`
	SaslUsername     string        `mapstructure:"sasl_username" toml:"sasl_username"`
	SaslPassword     string        `mapstructure:"sasl_password" toml:"sasl_password"`
	Topic            string        `mapstructure:"topic" toml:"topic"`
	Timeout          time.Duration `mapstructure:"timeout" toml:"timeout"`
	Group            string        `mapstructure:"group" toml:"group"`
	ClientID         string        `mapstructure:"client_id" toml:"client_id"`
	Enabled          bool          `mapstructure:"enabled" toml:"enabled"`
}

BrokerConfiguration represents configuration of a single-instance Kafka broker

type SCRAMClient

type SCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

SCRAMClient implementation for the SCRAM authentication

func (*SCRAMClient) Begin

func (x *SCRAMClient) Begin(userName, password, authzID string) (err error)

Begin prepares the client for the SCRAM exchange

func (*SCRAMClient) Done

func (x *SCRAMClient) Done() bool

Done should return true when the SCRAM conversation is over.

func (*SCRAMClient) Step

func (x *SCRAMClient) Step(challenge string) (response string, err error)

Step steps client through the SCRAM exchange

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL