kafka

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2017 License: MIT Imports: 8 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
}

Consumer represents a buffered Kafka consumer.

func New

func New(ctx context.Context, opts ...ConsumerFunc) (*Consumer, error)

New creates a new Consumer instance.

func (*Consumer) Close

func (c *Consumer) Close()

Close closes the Consumer.

func (*Consumer) GetNextBatch added in v1.0.0

func (c *Consumer) GetNextBatch(ctx context.Context, topic string, count int) ([][]byte, error)

GetNextBatch gets the next count messages from the queue.

func (*Consumer) GetNextMessage

func (c *Consumer) GetNextMessage(ctx context.Context, topic string) ([]byte, error)

GetNextMessage gets the next message from the queue.

type ConsumerFunc

type ConsumerFunc func(*Consumer)

ConsumerFunc represents a function that configures the Consumer.

func WithBrokers

func WithBrokers(brokers []string) ConsumerFunc

WithBrokers sets the brokers on the Consumer.

func WithBufferSize

func WithBufferSize(size int) ConsumerFunc

WithBufferSize sets the buffer size on the Consumer.

func WithGroupID

func WithGroupID(groupID string) ConsumerFunc

WithGroupID sets the group id on the Consumer.

func WithTopics

func WithTopics(topics []string) ConsumerFunc

WithTopics sets the topics on the Consumer.

Jump to

Keyboard shortcuts

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