kafka

package
v0.0.0-...-c424472 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 6 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 interface {
	Consume(cb func(value []byte) error)
	ConsumeMessage(cb func(value *sarama.ConsumerMessage) error)
	Close()
}

func InitConsumer

func InitConsumer(groupCfg types.Config, offsetCfg types.OffsetConfig) Consumer

func NewConsumerRepo

func NewConsumerRepo(cfg types.Config) (Consumer, error)

type IOffsetManagerRepo

type IOffsetManagerRepo interface {
	ResetPartitionOffset(offset int64)
	GetPartitionNextOffset() (offset int64, err error)
	Close()
}

type OffsetRepo

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

func NewOffsetManger

func NewOffsetManger(cfg types.OffsetConfig) (*OffsetRepo, error)

func (*OffsetRepo) Close

func (repo *OffsetRepo) Close()

func (*OffsetRepo) GetPartitionNextOffset

func (repo *OffsetRepo) GetPartitionNextOffset() (int64, error)

func (*OffsetRepo) ResetPartitionOffset

func (repo *OffsetRepo) ResetPartitionOffset(offset int64)

type Producer

type Producer interface {
	Produce(topic string, data []byte, partition int32) error
	Close()
}

func NewProducerRepo

func NewProducerRepo(cfg types.Config) (Producer, error)

Jump to

Keyboard shortcuts

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