kafka

package
v0.0.0-...-157c77b Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consumer

type Consumer struct {
	Addr  string
	Topic string
	// contains filtered or unexported fields
}

func NewKafkaConsumerClient

func NewKafkaConsumerClient(addr, topic string) *Consumer

func (*Consumer) AddMessageHandler

func (c *Consumer) AddMessageHandler(handler MessageHandler)

func (*Consumer) ListenMessage

func (c *Consumer) ListenMessage(ctx context.Context)

func (*Consumer) SendMessageToHandlers

func (c *Consumer) SendMessageToHandlers(message string)

type MessageHandler

type MessageHandler func(message string)

type Producer

type Producer struct {
	Addr  string
	Topic string
	// contains filtered or unexported fields
}

func NewKafkaProducerClient

func NewKafkaProducerClient(addr, topic string) *Producer

func (*Producer) SendMessage

func (p *Producer) SendMessage(ctx context.Context, message string) error

Jump to

Keyboard shortcuts

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