kafka

package
v0.0.0-...-388d6c9 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package kafka implements a kafka client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	SendMessage(ctx context.Context, msg *Message) (string, error)
	NewConsumer(ctx context.Context, topic, group string,
		handler func(context.Context, *Message) error) (Consumer, error)
	CreateTopic(ctx context.Context, topic string, numPartitions, replicationFactor int) error
	Close() error
}

Client kafka client interface

func New

func New(conf *configs.KafkaConfig) Client

New create a kafka client

type Consumer

type Consumer interface {
	Close() error
	Run(ctx context.Context)
}

Consumer kafka consumer interface

type Message

type Message = kafka.Message

Message kafka message body

Jump to

Keyboard shortcuts

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