Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SHA256 scram.HashGeneratorFcn = sha256.New SHA512 scram.HashGeneratorFcn = sha512.New )
Functions ¶
func IsTopicExist ¶
IsTopicExist returns whether an error is caused by a topic already existing.
func NewLeastBytesPartitioner ¶ added in v1.1.0
func NewLeastBytesPartitioner(topic string) sarama.Partitioner
NewLeastBytesPartitioner function takes topic as an argument, but it is not used. This has been done as it implements the sarama.PartitionerConstructor interface which requires it.
Types ¶
type Consumer ¶
type Consumer interface { Fetch(context.Context) (Message, error) Commit(context.Context, Message) error GroupMode() bool Close() error }
Consumer represents a Kafka Consumer.
func NewConsumer ¶
NewConsumer returns a new Kafka Consumer.
type Manager ¶
type Manager interface { CreateTopic(topic string, partitions, replication int) error Close() error }
Manager represents an object that can manage Kafka Producers and Consumers.
func NewManager ¶
func NewManager(cc conf.ConnectorConfig, bc conf.NATSKafkaBridgeConfig) (Manager, error)
NewManager returns a Kafka Manager.
type Message ¶
type Message struct { Topic string Partition int Offset int64 Key []byte Value []byte Headers []sarama.RecordHeader }
Message represents a Kafka message.
type Producer ¶
Producer represents a Kafka producer.
func NewErroredProducer ¶
NewErroredProducer returns a Producer that fails when any methods are called.
func NewProducer ¶
func NewProducer(cc conf.ConnectorConfig, bc conf.NATSKafkaBridgeConfig, topic string) (Producer, error)
NewProducer returns a new Kafka Producer.
type XDGSCRAMClient ¶ added in v1.3.0
type XDGSCRAMClient struct { *scram.Client *scram.ClientConversation scram.HashGeneratorFcn }
func (*XDGSCRAMClient) Begin ¶ added in v1.3.0
func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)
func (*XDGSCRAMClient) Done ¶ added in v1.3.0
func (x *XDGSCRAMClient) Done() bool
Click to show internal directories.
Click to hide internal directories.