confluent

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const PartitionAny = kafka.PartitionAny

Variables

This section is empty.

Functions

func UnmarshalKafkaValueToStruct

func UnmarshalKafkaValueToStruct[T any](msg *Message) (key string, data T, err error)

Types

type AdminKafkaClient

type AdminKafkaClient struct {
	*kafka.AdminClient
}

func (*AdminKafkaClient) CreateTopics

func (c *AdminKafkaClient) CreateTopics(
	ctx context.Context,
	topics []kafka.TopicSpecification,
	opt ...kafka.CreateTopicsAdminOption,
) error

func (*AdminKafkaClient) Stop

func (c *AdminKafkaClient) Stop()

type Adminer

type Adminer interface {
	CreateTopics(ctx context.Context, topics []TopicSpecification, opt ...CreateTopicsAdminOption) error
	Stop()
}

func NewAdminKafkaClient

func NewAdminKafkaClient(kafkaConfig *kafka.ConfigMap) (Adminer, error)

type Consumer

type Consumer interface {
	Start(ctx context.Context, createTopics []TopicSpecification, consumeTopics []string, maxWaitReadTimeout time.Duration, f ProcessEventFunc) (error, ErrChan)
	Stop()
}

type CreateTopicsAdminOption

type CreateTopicsAdminOption = kafka.CreateTopicsAdminOption

type ErrChan added in v1.7.2

type ErrChan = chan error // read only channel. non block. store error of kafka if not full.

type Event

type Event = kafka.Event

type Message

type Message = kafka.Message

type ProcessEventFunc

type ProcessEventFunc = func(*kafka.Consumer, *Message)

func GenDefaultProcessMsgWithZapLogger

func GenDefaultProcessMsgWithZapLogger[T any](
	log *zap.Logger,
	businessLogicFunc func(string, any) bool,
) ProcessEventFunc

type Producer

type Producer interface {
	Start(ctx context.Context, finishTimeoutFlushInMs int) (chan Event, error)
	Stop()
	Publish(msg *Message) error
	Flush(timeoutFlushInMs int)
}

type TopicPartition

type TopicPartition = kafka.TopicPartition

type TopicSpecification

type TopicSpecification = kafka.TopicSpecification

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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