kafka

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 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 {
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(addresses []string, groupId string, topics ...string) *Consumer

func (*Consumer) Polling

func (consumer *Consumer) Polling(callback ConsumerCallback)

Polling 接收

func (*Consumer) Stop

func (consumer *Consumer) Stop()

type ConsumerCallback

type ConsumerCallback func(topic string, val []byte)

type Producer

type Producer struct {
	// contains filtered or unexported fields
}

func NewProducer

func NewProducer(addresses []string, topic string) *Producer

func (*Producer) Write

func (p *Producer) Write(ctx context.Context, msg []byte) error

func (*Producer) WriteMessages

func (p *Producer) WriteMessages(ctx context.Context, msg ...[]byte) error

Jump to

Keyboard shortcuts

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