kafkalib

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 4 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(addr []string, topics []string, consumerGroupID string, handler sarama.ConsumerGroupHandler, opts ConsumerOptions) (*Consumer, error)

func (*Consumer) Shutdown

func (c *Consumer) Shutdown() error

func (*Consumer) Start

func (c *Consumer) Start(ctx context.Context) error

type ConsumerOptions added in v0.0.6

type ConsumerOptions struct {
	TLSConfig *tls.Config
}

type Handler

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

Handler is a convenience struct for creating a sarama.ConsumerGroupHandler

func NewHandler

func NewHandler(messageReceived func(payload []byte) error, opts ...HandlerOptions) *Handler

func (*Handler) Cleanup

func (h *Handler) Cleanup(sess sarama.ConsumerGroupSession) error

func (*Handler) ConsumeClaim

func (h *Handler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error

func (*Handler) Setup

func (h *Handler) Setup(sess sarama.ConsumerGroupSession) error

type HandlerOptions added in v0.0.3

type HandlerOptions struct {
	Setup   func(sess sarama.ConsumerGroupSession) error
	Cleanup func(sess sarama.ConsumerGroupSession) error
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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